Skip to content

Commit b862e45

Browse files
committed
Refactor test configuration and improve jest setup
Signed-off-by: Guido Scialfa <dev@guidoscialfa.com>
1 parent 382444c commit b862e45

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module.exports = {
44
preset: 'ts-jest',
55
moduleDirectories: ['node_modules'],
66
moduleNameMapper: {
7-
'^@/(.*)$': '<rootDir>/../src/$1',
8-
'^@model/(.*)$': '<rootDir>/../src/model/$1',
7+
'^@/(.*)$': '<rootDir>/src/$1',
8+
'^@model/(.*)$': '<rootDir>/src/model/$1',
99
},
10-
setupFilesAfterEnv: ['<rootDir>/setup-tests.ts'],
10+
setupFilesAfterEnv: ['<rootDir>/tests/setup-tests.ts'],
1111
maxWorkers: 8,
1212
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"lint": "eslint ./src --ext .ts",
3131
"lint:test": "eslint --config ./tests/.eslintrc.json ./tests --ext .ts",
3232
"prepare": "husky",
33-
"test": "jest --config ./tests/jest.config.ts",
33+
"test": "jest",
3434
"qa": "yarn lint && yarn lint:test && yarn test"
3535
}
3636
}

src/configuration.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export class Configuration {
1818
}
1919

2020
public get isTag(): boolean {
21-
const githubRef = this.env['GITHUB_REF'] ?? '';
22-
return githubRef.startsWith('refs/tags/');
21+
return (this.env['GITHUB_REF'] ?? '').startsWith('refs/tags/');
2322
}
2423
}

tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
},
1010
"rootDir": "./"
1111
},
12-
"include": ["../src/**/*.ts", "./unit/**/*.ts", "jest.config.ts", "setup-tests.ts"],
12+
"include": ["../src/**/*.ts", "./unit/**/*.ts", "../jest.config.ts", "setup-tests.ts"],
1313
"exclude": ["../node_modules"]
1414
}

0 commit comments

Comments
 (0)