This commit is contained in:
parent
c56f59b93f
commit
21248e421c
|
@ -16,7 +16,7 @@ import fs from "fs";
|
|||
export const app = express();
|
||||
|
||||
app.use(express.static("static"));
|
||||
app.use(express.urlencoded());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
app.get("/", (req, res) =>
|
||||
res.send(
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
import { app } from "./server";
|
||||
import { feedPath } from "./components";
|
||||
import request from "supertest";
|
||||
import fs from "fs";
|
||||
|
||||
test("create feed", async () => {
|
||||
const response = await request(app)
|
||||
.post("/")
|
||||
.send({ name: "My Feed" });
|
||||
JSON.stringify(response, null, 2);
|
||||
.send("name=My Feed");
|
||||
const token = response.text.match(/(\w{20}).xml/)![1];
|
||||
const feed = fs.readFileSync(feedPath(token)).toString();
|
||||
|
||||
expect(feed).toMatch("My Feed");
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue