Skip to content

Commit 0643b03

Browse files
authored
Merge pull request #348 from Bnaya/start-dir-cwd
Set the start dir of looking for tsconfig to process.cwd()
2 parents 7b15180 + c19b7e1 commit 0643b03

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-jest",
3-
"version": "21.1.2",
3+
"version": "21.1.3",
44
"main": "index.js",
55
"types": "./dist/index.d.ts",
66
"description": "A preprocessor with sourcemap support to help use Typescript with Jest",
@@ -31,6 +31,7 @@
3131
],
3232
"author": "Kulshekhar Kabra <kulshekhar@users.noreply.github.com> (https://github.com/kulshekhar)",
3333
"contributors": [
34+
"Bnaya Peretz <me@bnaya.net> (https://github.com/Bnaya)",
3435
"Brian Ruddy <briancruddy@gmail.com> (https://github.com/bcruddy)",
3536
"Emil Persson <emil.n.persson@gmail.com> (https://github.com/emilniklas)",
3637
"Gustav Wengel <gustavwengel@gmail.com>(https://github.com/GeeWee)",

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ function getStartDir(): string {
123123

124124
const grandparent = path.resolve(__dirname, '..', '..');
125125
if (grandparent.endsWith('/node_modules')) {
126-
return path.resolve(grandparent, '..');
126+
return process.cwd();
127127
}
128+
128129
return '.';
129130
}
130131

tests/__tests__/synthetic-default-imports.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('synthetic default imports', () => {
1010
expect(stderr).toContain(
1111
`TypeError: Cannot read property 'someExport' of undefined`,
1212
);
13-
expect(stderr).toContain('module.test.ts:6:15');
13+
expect(stderr).toContain('module.test.ts:6');
1414
});
1515

1616
it('should work when the compiler option is true', () => {

0 commit comments

Comments
 (0)