// Path matching test("Html file in root folder", () => { // expect.assertions(1); return get("/heading").then(data => { const $ = cheerio.load(data); expect( $("h1") .text() .trim() ).toBe("title"); }); });
test("React With Hooks", () => { //expect.assertions(1); return get("/react/withHook").then(data => { const $ = cheerio.load(data); expect($("p").text()).toBe("You clicked 0 times"); }); });
test(".MDX File (With .MD Import)", () => { //expect.assertions(1); return get("/mdx/withimport").then(data => { const $ = cheerio.load(data); expect( $("body h1") .text() .trim() ).toBe("Heading"); }); });
test("React With getInitialProps", () => { //expect.assertions(1); return get("/react/withInitialProps").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("2,4,6"); }); });
test("Svelte with query param", () => { //expect.assertions(1); return get("/svelte/withQuery?name=Asad").then(data => { const $ = cheerio.load(data); expect( $("body h1") .text() .trim() ).toBe("Hello Asad"); }); });
test("Svelte (nested) with query param", () => { //expect.assertions(1); return get("/svelte/withQuery?name=Asad").then(data => { const $ = cheerio.load(data); expect( $("body h1") .text() .trim() ).toBe("Hello Asad"); }); });
test("Vue With Head/Meta Tags", () => { //expect.assertions(1); return get("/vue/withhead").then(data => { const $ = cheerio.load(data); expect( $("head title") .text() .trim() ).toBe("My Title"); }); });
test("HTML (Simple)", () => { //expect.assertions(1); return get("/html").then(data => { const $ = cheerio.load(data); expect( $("body h1") .text() .trim() ).toBe("Title"); }); });
test(".MDX File (With .JSX Import)", () => { //expect.assertions(1); return get("/mdx/withimportjsx").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("react-stateless"); }); });
// React Page test("React Stateless", () => { //expect.assertions(1); return get("/react/stateless").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("react-stateless"); }); });
test("React With Imports", () => { //expect.assertions(1); return get("/react/withimports").then(data => { const $ = cheerio.load(data); expect( $("body") .text() .trim() ).toBe("246react-stateless"); }); });
test("React With TypeScript", () => { //expect.assertions(1); return get("/react/typescript").then(data => { const $ = cheerio.load(data); expect($("b").text()).toBe("Hello TypeScript"); }); });
test("React With Class Properties", () => { //expect.assertions(1); return get("/react/withClassProperties").then(data => { const $ = cheerio.load(data); expect($("button").text()).toBe("Click Me!"); }); });
test("Svelte With Head", () => { //expect.assertions(1); return get("/svelte/withhead").then(data => { const $ = cheerio.load(data); expect( $("head title") .text() .trim() ).toBe("Page Title"); }); });
test("Svelte With Preloading", () => { //expect.assertions(1); return get("/svelte/withpreloading").then(data => { const $ = cheerio.load(data); expect( $("body p") .text() .trim() ).toBe("2,4,6"); }); });