-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
874092b
commit d6d32e7
Showing
7 changed files
with
103 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
import tsd from './lib'; | ||
|
||
export * from './lib/assert'; | ||
export default tsd; |
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
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,34 @@ | ||
import * as path from 'path'; | ||
import test from 'ava'; | ||
import * as execa from 'execa'; | ||
|
||
interface ExecaError extends Error { | ||
readonly exitCode: number; | ||
readonly stderr: string; | ||
} | ||
|
||
test('fail if errors are found', async t => { | ||
const {exitCode, stderr} = await t.throwsAsync<ExecaError>(execa('../../../cli.js', { | ||
cwd: path.join(__dirname, 'fixtures/failure') | ||
})); | ||
|
||
t.is(exitCode, 1); | ||
t.regex(stderr, /5:19[ ]{2}Argument of type number is not assignable to parameter of type string./); | ||
}); | ||
|
||
test('succeed if no errors are found', async t => { | ||
const {exitCode} = await execa('../../../cli.js', { | ||
cwd: path.join(__dirname, 'fixtures/success') | ||
}); | ||
|
||
t.is(exitCode, 0); | ||
}); | ||
|
||
test('provide a path', async t => { | ||
const file = path.join(__dirname, 'fixtures/failure'); | ||
|
||
const {exitCode, stderr} = await t.throwsAsync<ExecaError>(execa('dist/cli.js', [file])); | ||
|
||
t.is(exitCode, 1); | ||
t.regex(stderr, /5:19[ ]{2}Argument of type number is not assignable to parameter of type string./); | ||
}); |
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