-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: tests/integration/didyoumean.test.cjs (#5912)
* refactor: file reorganization for didyoumean test - rename test file - move snapshot files to new destination * refactor: convert file to ESM * refactor: replace ava with vitest - replace ava with vitest - adjust tests accordingly - update snapshots * style: apply lint rules --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0fc2bad
commit 07d3111
Showing
5 changed files
with
34 additions
and
44 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
tests/integration/commands/didyoumean/__snapshots__/didyoumean.test.mjs.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`suggests closest matching command on typo 1`] = ` | ||
"› Warning: sta is not a netlify command. | ||
? Did you mean api (y/N) [25D[25C" | ||
`; | ||
|
||
exports[`suggests closest matching command on typo 2`] = ` | ||
"› Warning: opeen is not a netlify command. | ||
? Did you mean open (y/N) [26D[26C" | ||
`; | ||
|
||
exports[`suggests closest matching command on typo 3`] = ` | ||
"› Warning: hel is not a netlify command. | ||
? Did you mean dev (y/N) [25D[25C" | ||
`; | ||
|
||
exports[`suggests closest matching command on typo 4`] = ` | ||
"› Warning: versio is not a netlify command. | ||
? Did you mean serve (y/N) [27D[27C" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { test } from 'vitest' | ||
|
||
import callCli from '../../utils/call-cli.cjs' | ||
import { normalize } from '../../utils/snapshots.cjs' | ||
|
||
test('suggests closest matching command on typo', async (t) => { | ||
// failures are expected since we effectively quit out of the prompts | ||
const errors = await Promise.allSettled([callCli(['sta']), callCli(['opeen']), callCli(['hel']), callCli(['versio'])]) | ||
errors.forEach((error) => { | ||
t.expect(error.status).toEqual('rejected') | ||
t.expect(normalize(error.reason.stdout, { duration: true, filePath: true })).toMatchSnapshot() | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
07d3111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Benchmark results