This commit is contained in:
parent
c56f59b93f
commit
21248e421c
|
@ -16,7 +16,7 @@ import fs from "fs";
|
||||||
export const app = express();
|
export const app = express();
|
||||||
|
|
||||||
app.use(express.static("static"));
|
app.use(express.static("static"));
|
||||||
app.use(express.urlencoded());
|
app.use(express.urlencoded({ extended: true }));
|
||||||
|
|
||||||
app.get("/", (req, res) =>
|
app.get("/", (req, res) =>
|
||||||
res.send(
|
res.send(
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
import { app } from "./server";
|
import { app } from "./server";
|
||||||
|
import { feedPath } from "./components";
|
||||||
import request from "supertest";
|
import request from "supertest";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
test("create feed", async () => {
|
test("create feed", async () => {
|
||||||
const response = await request(app)
|
const response = await request(app)
|
||||||
.post("/")
|
.post("/")
|
||||||
.send({ name: "My Feed" });
|
.send("name=My Feed");
|
||||||
JSON.stringify(response, null, 2);
|
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