Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add a couple tsc tests (#1183)
- Loading branch information
1 parent
c18fb0a
commit 1f535d7
Showing
8 changed files
with
103 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* IMPORTANT | ||
* This snapshot file is auto-generated, but designed for humans. | ||
* It should be checked into source control and tracked carefully. | ||
* Re-generate by setting TAP_SNAPSHOT=1 and running tests. | ||
* Make sure to inspect the output below. Do not ignore changes! | ||
*/ | ||
'use strict' | ||
exports[`test/tsc.js TAP ignore source-map > stdout 1`] = ` | ||
------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
------------|---------|----------|---------|---------|------------------- | ||
All files | 38.46 | 57.14 | 66.67 | 50 | | ||
mapping.js | 38.46 | 57.14 | 66.67 | 50 | 3,4,5,6,8 | ||
------------|---------|----------|---------|---------|------------------- | ||
` | ||
|
||
exports[`test/tsc.js TAP reads source-map > stdout 1`] = ` | ||
------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
------------|---------|----------|---------|---------|------------------- | ||
All files | 100 | 100 | 100 | 100 | | ||
mapping.ts | 100 | 100 | 100 | 100 | | ||
------------|---------|----------|---------|---------|------------------- | ||
` |
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 @@ | ||
package-lock=false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
function munge1 (obj: Object) { | ||
return { | ||
name: 'munge1', | ||
...obj | ||
}; | ||
} | ||
|
||
munge1({}) |
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,15 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"postinstall": "tsc" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.6.3" | ||
}, | ||
"nyc": { | ||
"reporter": [ | ||
"text", | ||
"html" | ||
] | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"sourceMap": true | ||
}, | ||
"files": [ | ||
"mapping.ts" | ||
] | ||
} |
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,28 @@ | ||
'use strict' | ||
|
||
const path = require('path') | ||
const t = require('tap') | ||
|
||
const { testSuccess } = require('./helpers') | ||
const fixturesTSC = path.resolve(__dirname, 'fixtures/tsc') | ||
|
||
t.test('reads source-map', t => testSuccess(t, { | ||
cwd: fixturesTSC, | ||
args: [ | ||
'--produce-source-map=true', | ||
'--cache=false', | ||
process.execPath, | ||
'mapping.js' | ||
] | ||
})) | ||
|
||
t.test('ignore source-map', t => testSuccess(t, { | ||
cwd: fixturesTSC, | ||
args: [ | ||
'--produce-source-map=true', | ||
'--no-source-map', | ||
'--cache=false', | ||
process.execPath, | ||
'mapping.js' | ||
] | ||
})) |