[now-cli] Loosen "engines" requirement to Node >= 8 (#3195)

Now that `now-client` does not use `fetch-h2`, any version of Node 8 or newer should work with `now-cli`.

Related to #2711.
This commit is contained in:
Nathan Rajlich
2019-10-24 17:38:21 -07:00
committed by kodiakhq[bot]
parent c7caa7b905
commit 34dce350be
3 changed files with 137 additions and 92 deletions

View File

@@ -335,18 +335,25 @@ if (satisfies(process.version, '10.x')) {
console.log('Skipping `02-angular-node` test since it requires Node >= 10.9');
}
test(
'[now dev] 03-aurelia',
testFixtureStdio('03-aurelia', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// eslint has `engines: { node: ">^6.14.0 || ^8.10.0 || >=9.10.0" }` in its `package.json`
if (satisfies(process.version, '>^6.14.0 || ^8.10.0 || >=9.10.0')) {
test(
'[now dev] 03-aurelia',
testFixtureStdio('03-aurelia', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Aurelia Navigation Skeleton/gm);
})
);
const body = await response.text();
t.regex(body, /Aurelia Navigation Skeleton/gm);
})
);
} else {
console.log(
'Skipping `03-aurelia` test since it requires Node >= ^6.14.0 || ^8.10.0 || >=9.10.0'
);
}
// test(
// '[now dev] 04-create-react-app-node',
@@ -361,31 +368,45 @@ test(
// })
// );
test(
'[now dev] 05-gatsby',
testFixtureStdio('05-gatsby', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// eslint has `engines: { node: ">^6.14.0 || ^8.10.0 || >=9.10.0" }` in its `package.json`
if (satisfies(process.version, '>^6.14.0 || ^8.10.0 || >=9.10.0')) {
test(
'[now dev] 05-gatsby',
testFixtureStdio('05-gatsby', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Gatsby Default Starter/gm);
})
);
const body = await response.text();
t.regex(body, /Gatsby Default Starter/gm);
})
);
} else {
console.log(
'Skipping `05-gatsby` test since it requires Node >= ^6.14.0 || ^8.10.0 || >=9.10.0'
);
}
test(
'[now dev] 06-gridsome',
testFixtureStdio('06-gridsome', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// mini-css-extract-plugin has `engines: { node: ">= 6.9.0 <7.0.0 || >= 8.9.0" }` in its `package.json`
if (satisfies(process.version, '>= 6.9.0 <7.0.0 || >= 8.9.0')) {
test(
'[now dev] 06-gridsome',
testFixtureStdio('06-gridsome', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Hello, world!/gm);
})
);
const body = await response.text();
t.regex(body, /Hello, world!/gm);
})
);
} else {
console.log(
'Skipping `06-gridsome` test since it requires Node >= 6.9.0 <7.0.0 || >= 8.9.0'
);
}
test(
'[now dev] 07-hexo-node',
@@ -634,18 +655,25 @@ test('[now dev] double slashes redirect', async t => {
}
});
test(
'[now dev] 18-marko',
testFixtureStdio('18-marko', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// eslint has `engines: { node: ">^6.14.0 || ^8.10.0 || >=9.10.0" }` in its `package.json`
if (satisfies(process.version, '>^6.14.0 || ^8.10.0 || >=9.10.0')) {
test(
'[now dev] 18-marko',
testFixtureStdio('18-marko', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Marko Starter/gm);
})
);
const body = await response.text();
t.regex(body, /Marko Starter/gm);
})
);
} else {
console.log(
'Skipping `18-marko` test since it requires Node >= ^6.14.0 || ^8.10.0 || >=9.10.0'
);
}
test(
'[now dev] 19-mithril',
@@ -673,18 +701,23 @@ test(
})
);
test(
'[now dev] 21-charge',
testFixtureStdio('21-charge', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// @static/charge has `engines: { node: ">= 8.10.0" }` in its `package.json`
if (satisfies(process.version, '>= 8.10.0')) {
test(
'[now dev] 21-charge',
testFixtureStdio('21-charge', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Welcome to my new Charge site/gm);
})
);
const body = await response.text();
t.regex(body, /Welcome to my new Charge site/gm);
})
);
} else {
console.log('Skipping `21-charge` test since it requires Node >= 8.10.0');
}
test(
'[now dev] 22-brunch',
@@ -699,31 +732,43 @@ test(
})
);
test(
'[now dev] 23-docusaurus',
testFixtureStdio('23-docusaurus', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// react-dev-utils has `engines: { node: ">= 8.10" }` in its `package.json`
if (satisfies(process.version, '>= 8.10')) {
test(
'[now dev] 23-docusaurus',
testFixtureStdio('23-docusaurus', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Test Site · A website for testing/gm);
})
);
const body = await response.text();
t.regex(body, /Test Site · A website for testing/gm);
})
);
} else {
console.log('Skipping `23-docusaurus` test since it requires Node >= 8.10');
}
test(
'[now dev] 24-ember',
testFixtureStdio('24-ember', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
// eslint has `engines: { node: ">^6.14.0 || ^8.10.0 || >=9.10.0" }` in its `package.json`
if (satisfies(process.version, '>^6.14.0 || ^8.10.0 || >=9.10.0')) {
test(
'[now dev] 24-ember',
testFixtureStdio('24-ember', async (t, port) => {
const result = fetch(`http://localhost:${port}`);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /HelloWorld/gm);
})
);
const body = await response.text();
t.regex(body, /HelloWorld/gm);
})
);
} else {
console.log(
'Skipping `24-ember` test since it requires Node >= ^6.14.0 || ^8.10.0 || >=9.10.0'
);
}
test('[now dev] temporary directory listing', async t => {
const directory = fixture('temporary-directory-listing');
@@ -942,22 +987,28 @@ test('[now dev] do not rebuild for changes in the output directory', async t =>
}
});
test('[now dev] 25-nextjs-src-dir', async t => {
const directory = fixture('25-nextjs-src-dir');
const { dev, port } = await testFixture(directory);
if (satisfies(process.version, '>= 8.9.0')) {
test('[now dev] 25-nextjs-src-dir', async t => {
const directory = fixture('25-nextjs-src-dir');
const { dev, port } = await testFixture(directory);
try {
// start `now dev` detached in child_process
dev.unref();
try {
// start `now dev` detached in child_process
dev.unref();
const result = await fetchWithRetry(`http://localhost:${port}`, 80);
const response = await result;
const result = await fetchWithRetry(`http://localhost:${port}`, 80);
const response = await result;
validateResponseHeaders(t, response);
validateResponseHeaders(t, response);
const body = await response.text();
t.regex(body, /Next.js \+ Node.js API/gm);
} finally {
dev.kill('SIGTERM');
}
});
const body = await response.text();
t.regex(body, /Next.js \+ Node.js API/gm);
} finally {
dev.kill('SIGTERM');
}
});
} else {
console.log(
'Skipping `25-nextjs-src-dir` test since it requires Node >= 8.9.0'
);
}