Skip to content

Commit

Permalink
fix test failures caused by prettier formatting changes (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Feb 27, 2021
1 parent 16c9843 commit 6deb120
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Expand Up @@ -7,3 +7,6 @@
!/src
!/tests
tests/main-realpath/symlink/tsconfig.json
tests/throw.ts
tests/throw-react-tsx.tsx
tests/esm/throw.ts
18 changes: 9 additions & 9 deletions src/index.spec.ts
Expand Up @@ -278,8 +278,8 @@ test.suite('ts-node', (test) => {
expect(err.message).to.contain(
[
`${join(TEST_DIR, 'throw.ts')}:100`,
" bar () { throw new Error('this is a demo') }",
' ^',
" bar() { throw new Error('this is a demo'); }",
' ^',
'Error: this is a demo',
].join('\n')
);
Expand All @@ -294,8 +294,8 @@ test.suite('ts-node', (test) => {
expect(err.message).to.contain(
[
`${join(TEST_DIR, 'throw.ts')}:100`,
" bar () { throw new Error('this is a demo') }",
' ^',
" bar() { throw new Error('this is a demo'); }",
' ^',
].join('\n')
);
});
Expand Down Expand Up @@ -427,8 +427,8 @@ test.suite('ts-node', (test) => {
expect(err!.message).to.contain(
[
`${join(TEST_DIR, './throw-react-tsx.tsx')}:100`,
" bar () { throw new Error('this is a demo') }",
' ^',
" bar() { throw new Error('this is a demo'); }",
' ^',
'Error: this is a demo',
].join('\n')
);
Expand Down Expand Up @@ -981,7 +981,7 @@ test.suite('ts-node', (test) => {
expect(error.stack).to.contain(
[
'Error: this is a demo',
` at Foo.bar (${join(TEST_DIR, './throw.ts')}:100:18)`,
` at Foo.bar (${join(TEST_DIR, './throw.ts')}:100:17)`,
].join('\n')
);
}
Expand Down Expand Up @@ -1142,8 +1142,8 @@ test.suite('ts-node', (test) => {
expect(err!.message).to.contain(
[
`${pathToFileURL(join(TEST_DIR, './esm/throw.ts'))}:100`,
" bar () { throw new Error('this is a demo') }",
' ^',
" bar() { throw new Error('this is a demo'); }",
' ^',
'Error: this is a demo',
].join('\n')
);
Expand Down
97 changes: 94 additions & 3 deletions tests/esm/throw.ts
@@ -1,12 +1,103 @@
// intentional whitespace to prove that sourcemaps are working. Throw should happen on line 100.
// 100 lines is meant to be far more space than the helper functions would take.





























































































class Foo {
constructor() {
this.bar();
}
bar() {
throw new Error('this is a demo');
}
bar() { throw new Error('this is a demo'); }
}
new Foo();
export {};
96 changes: 93 additions & 3 deletions tests/throw-react-tsx.tsx
@@ -1,13 +1,103 @@
// intentional whitespace to prove that sourcemaps are working. Throw should happen on line 100.
// 100 lines is meant to be far more space than the helper functions would take.




























































































const React = { createElement: (...args: any[]) => null };
class Foo {
constructor() {
this.bar();
}
bar() {
throw new Error('this is a demo');
}
bar() { throw new Error('this is a demo'); }
someJsx() {
return <div />;
}
Expand Down
97 changes: 94 additions & 3 deletions tests/throw.ts
@@ -1,12 +1,103 @@
// intentional whitespace to prove that sourcemaps are working. Throw should happen on line 100.
// 100 lines is meant to be far more space than the helper functions would take.





























































































class Foo {
constructor() {
this.bar();
}
bar() {
throw new Error('this is a demo');
}
bar() { throw new Error('this is a demo'); }
}
new Foo();
export {};

0 comments on commit 6deb120

Please sign in to comment.