Skip to content

Commit e197021

Browse files
authored
test(create-amplify): add e2e test for create-amplify help (#1048)
* update package-lock * add e2e test for create-amplify help * add changeset * change asserts
1 parent 415c4c1 commit e197021

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.changeset/light-cougars-give.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/integration-tests/src/test-e2e/create_amplify.test.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ void describe(
3232
// Force 'create-amplify' installation in npx cache by executing help command
3333
// before tests run. Otherwise, installing 'create-amplify' concurrently
3434
// may lead to race conditions and corrupted npx cache.
35-
await execa('npm', ['create', amplifyAtTag, '--yes', '--', '--help'], {
36-
// Command must run outside of 'amplify-backend' workspace.
37-
cwd: os.homedir(),
38-
stdio: 'inherit',
39-
});
35+
const output = await execa(
36+
'npm',
37+
['create', amplifyAtTag, '--yes', '--', '--help'],
38+
{
39+
// Command must run outside of 'amplify-backend' workspace.
40+
cwd: os.homedir(),
41+
}
42+
);
43+
44+
assert.match(output.stdout, /--help/);
45+
assert.match(output.stdout, /--version/);
46+
assert.match(output.stdout, /Show version number/);
47+
assert.match(output.stdout, /--yes/);
4048

4149
// Prefixing with ~. Otherwise, npm is going to install desired version but
4250
// declare dependency with ^ in package json. So just in case removing that

0 commit comments

Comments
 (0)