Skip to content

Commit 60d1d20

Browse files
authored
feat: Add new CLI name of js-compute which matches the published package name @fastly/js-compute (#869)
1 parent 08a1e5d commit 60d1d20

16 files changed

+29
-25
lines changed

integration-tests/cli/build-config.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should build the fastly condition', async function (t) {
88
const { execute, cleanup, writeFile, exists, path } = await prepareEnvironment();
@@ -13,7 +13,7 @@ test('should build the fastly condition', async function (t) {
1313
await writeFile('./index.js', `import '#test';`)
1414
await writeFile('./test.js', `addEventListener('fetch', function(){})`)
1515
await writeFile('./package.json', `{ "type": "module", "imports": { "#test": { "fastly": "./test.js" } } }`)
16-
16+
1717
t.is(await exists('./app.wasm'), false)
1818

1919
const { code, stdout, stderr } = await execute(process.execPath, `${cli} ${path}/index.js ${path}/app.wasm`);

integration-tests/cli/custom-input-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should create wasm file and return zero exit code', async function (t) {
88
const { execute, cleanup, writeFile, exists, path } = await prepareEnvironment();

integration-tests/cli/custom-output-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should create output directory, wasm file and return zero exit code', async function (t) {
88
const { execute, cleanup, writeFile, exists, path } = await prepareEnvironment();

integration-tests/cli/disable-starlingmonkey.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should create wasm file and return zero exit code for StarlingMonkey', async function (t) {
88
const { execute, cleanup, writeFile, exists } = await prepareEnvironment();

integration-tests/cli/engine-wasm-path-is-not-a-file.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should return non-zero exit code', async function (t) {
88
const { execute, cleanup, makeDir, writeFile, path} = await prepareEnvironment();

integration-tests/cli/help.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ const packageJson = readFileSync(join(__dirname, "../../package.json"), {
1111
});
1212
const version = JSON.parse(packageJson).version;
1313

14-
const cli = await getBinPath()
14+
const cli = await getBinPath({name:"js-compute"})
1515

1616
test('--help should return help on stdout and zero exit code', async function (t) {
1717
const { execute, cleanup } = await prepareEnvironment();
1818
t.teardown(async function () {
1919
await cleanup();
2020
});
21-
const { code, stdout, stderr } = await execute(process.execPath, `${cli} --help`);
21+
const { code, stdout, stderr } = await execute(cli, `--help`);
2222

2323
t.is(code, 0);
2424
t.alike(stdout, [
25-
`js-compute-runtime ${version}`,
25+
`js-compute-runtime-cli.js ${version}`,
2626
'USAGE:',
27-
'js-compute-runtime [FLAGS] [OPTIONS] [ARGS]',
27+
'js-compute-runtime-cli.js [FLAGS] [OPTIONS] [ARGS]',
2828
'FLAGS:',
2929
'-h, --help Prints help information',
3030
'-V, --version Prints version information',
@@ -44,13 +44,13 @@ test('-h should return help on stdout and zero exit code', async function (t) {
4444
t.teardown(async function () {
4545
await cleanup();
4646
});
47-
const { code, stdout, stderr } = await execute(process.execPath, `${cli} -h`);
47+
const { code, stdout, stderr } = await execute(cli, `-h`);
4848

4949
t.is(code, 0);
5050
t.alike(stdout, [
51-
`js-compute-runtime ${version}`,
51+
`js-compute-runtime-cli.js ${version}`,
5252
'USAGE:',
53-
'js-compute-runtime [FLAGS] [OPTIONS] [ARGS]',
53+
'js-compute-runtime-cli.js [FLAGS] [OPTIONS] [ARGS]',
5454
'FLAGS:',
5555
'-h, --help Prints help information',
5656
'-V, --version Prints version information',

integration-tests/cli/input-path-is-not-a-file.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should return non-zero exit code', async function (t) {
88
const { execute, cleanup, makeDir} = await prepareEnvironment();

integration-tests/cli/invalid.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should return non-zero exit code on syntax errors', async function (t) {
88
const { execute, cleanup, writeFile } = await prepareEnvironment();

integration-tests/cli/non-existent-engine-wasm-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should return non-zero exit code', async function (t) {
88
const { execute, cleanup, writeFile,path} = await prepareEnvironment();

integration-tests/cli/non-existent-input-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import test from 'brittle';
22
import { getBinPath } from 'get-bin-path'
33
import { prepareEnvironment } from '@jakechampion/cli-testing-library';
44

5-
const cli = await getBinPath()
5+
const cli = await getBinPath({name:"js-compute"})
66

77
test('should return non-zero exit code', async function (t) {
88
const { execute, cleanup} = await prepareEnvironment();

0 commit comments

Comments
 (0)