Skip to content

Commit

Permalink
Merge pull request #348 from Bnaya/start-dir-cwd
Browse files Browse the repository at this point in the history
Set the start dir of looking for tsconfig to process.cwd()
  • Loading branch information
kulshekhar committed Oct 17, 2017
2 parents 7b15180 + c19b7e1 commit 0643b03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ts-jest",
"version": "21.1.2",
"version": "21.1.3",
"main": "index.js",
"types": "./dist/index.d.ts",
"description": "A preprocessor with sourcemap support to help use Typescript with Jest",
Expand Down Expand Up @@ -31,6 +31,7 @@
],
"author": "Kulshekhar Kabra <kulshekhar@users.noreply.github.com> (https://github.com/kulshekhar)",
"contributors": [
"Bnaya Peretz <me@bnaya.net> (https://github.com/Bnaya)",
"Brian Ruddy <briancruddy@gmail.com> (https://github.com/bcruddy)",
"Emil Persson <emil.n.persson@gmail.com> (https://github.com/emilniklas)",
"Gustav Wengel <gustavwengel@gmail.com>(https://github.com/GeeWee)",
Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Expand Up @@ -123,8 +123,9 @@ function getStartDir(): string {

const grandparent = path.resolve(__dirname, '..', '..');
if (grandparent.endsWith('/node_modules')) {
return path.resolve(grandparent, '..');
return process.cwd();
}

return '.';
}

Expand Down
2 changes: 1 addition & 1 deletion tests/__tests__/synthetic-default-imports.spec.ts
Expand Up @@ -10,7 +10,7 @@ describe('synthetic default imports', () => {
expect(stderr).toContain(
`TypeError: Cannot read property 'someExport' of undefined`,
);
expect(stderr).toContain('module.test.ts:6:15');
expect(stderr).toContain('module.test.ts:6');
});

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

0 comments on commit 0643b03

Please sign in to comment.