|
1 | 1 | // Test next-on-netlify when i18n is set in next.config.js (Next 10+)
|
2 | 2 |
|
3 |
| -const { parse, join } = require("path"); |
| 3 | +const { parse, join, sep } = require("path"); |
4 | 4 | const {
|
5 | 5 | existsSync,
|
6 | 6 | readdirSync,
|
@@ -45,33 +45,68 @@ describe("next-on-netlify", () => {
|
45 | 45 | describe("next-on-netlify", () => {
|
46 | 46 | test("builds successfully", () => {
|
47 | 47 | expect(buildOutput).toMatch("Next on Netlify");
|
48 |
| - expect(buildOutput).toMatch("Copying static NextJS assets to out_publish/"); |
49 | 48 | expect(buildOutput).toMatch(
|
50 |
| - "Setting up API endpoints as Netlify Functions in out_functions/" |
| 49 | + `Copying static NextJS assets to out_publish${sep}` |
51 | 50 | );
|
52 | 51 | expect(buildOutput).toMatch(
|
53 |
| - "Setting up pages with getInitialProps as Netlify Functions in out_functions/" |
| 52 | + `Setting up API endpoints as Netlify Functions in out_functions${sep}` |
54 | 53 | );
|
55 | 54 | expect(buildOutput).toMatch(
|
56 |
| - "Setting up pages with getServerSideProps as Netlify Functions in out_functions/" |
| 55 | + `Setting up pages with getInitialProps as Netlify Functions in out_functions${sep}` |
57 | 56 | );
|
58 | 57 | expect(buildOutput).toMatch(
|
59 |
| - "Copying pre-rendered pages with getStaticProps and JSON data to out_publish/" |
| 58 | + `Setting up pages with getServerSideProps as Netlify Functions in out_functions${sep}` |
60 | 59 | );
|
61 | 60 | expect(buildOutput).toMatch(
|
62 |
| - "Setting up pages with getStaticProps and fallback: true as Netlify Functions in out_functions/" |
| 61 | + `Copying pre-rendered pages with getStaticProps and JSON data to out_publish${sep}` |
63 | 62 | );
|
64 | 63 | expect(buildOutput).toMatch(
|
65 |
| - "Setting up pages with getStaticProps and revalidation interval as Netlify Functions in out_functions/" |
| 64 | + `Setting up pages with getStaticProps and fallback: true as Netlify Functions in out_functions${sep}` |
66 | 65 | );
|
67 | 66 | expect(buildOutput).toMatch(
|
68 |
| - "Copying pre-rendered pages without props to out_publish/" |
| 67 | + `Setting up pages with getStaticProps and revalidation interval as Netlify Functions in out_functions${sep}` |
| 68 | + ); |
| 69 | + expect(buildOutput).toMatch( |
| 70 | + `Copying pre-rendered pages without props to out_publish${sep}` |
69 | 71 | );
|
70 | 72 | expect(buildOutput).toMatch("Setting up redirects");
|
71 | 73 | expect(buildOutput).toMatch("Success! All done!");
|
72 | 74 | });
|
73 | 75 | });
|
74 | 76 |
|
| 77 | +// describe("next-on-netlify", () => { |
| 78 | +// test("builds successfully", () => { |
| 79 | +// expect(buildOutput).toMatch("Next on Netlify"); |
| 80 | +// expect(buildOutput).toMatch( |
| 81 | +// `Copying public${sep} folder to out_publish${sep}` |
| 82 | +// ); |
| 83 | +// expect(buildOutput).toMatch("Copying static NextJS assets to out_publish/"); |
| 84 | +// expect(buildOutput).toMatch( |
| 85 | +// "Setting up API endpoints as Netlify Functions in out_functions/" |
| 86 | +// ); |
| 87 | +// expect(buildOutput).toMatch( |
| 88 | +// "Setting up pages with getInitialProps as Netlify Functions in out_functions/" |
| 89 | +// ); |
| 90 | +// expect(buildOutput).toMatch( |
| 91 | +// "Setting up pages with getServerSideProps as Netlify Functions in out_functions/" |
| 92 | +// ); |
| 93 | +// expect(buildOutput).toMatch( |
| 94 | +// "Copying pre-rendered pages with getStaticProps and JSON data to out_publish/" |
| 95 | +// ); |
| 96 | +// expect(buildOutput).toMatch( |
| 97 | +// "Setting up pages with getStaticProps and fallback: true as Netlify Functions in out_functions/" |
| 98 | +// ); |
| 99 | +// expect(buildOutput).toMatch( |
| 100 | +// "Setting up pages with getStaticProps and revalidation interval as Netlify Functions in out_functions/" |
| 101 | +// ); |
| 102 | +// expect(buildOutput).toMatch( |
| 103 | +// "Copying pre-rendered pages without props to out_publish/" |
| 104 | +// ); |
| 105 | +// expect(buildOutput).toMatch("Setting up redirects"); |
| 106 | +// expect(buildOutput).toMatch("Success! All done!"); |
| 107 | +// }); |
| 108 | +// }); |
| 109 | + |
75 | 110 | describe("SSR Pages", () => {
|
76 | 111 | const functionsDir = join(PROJECT_PATH, "out_functions");
|
77 | 112 |
|
|
0 commit comments