Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 8e117ea

Browse files
committed
fix: jest config & test fixes
1 parent 4d9c587 commit 8e117ea

File tree

7 files changed

+67
-19
lines changed

7 files changed

+67
-19
lines changed

.vscode/settings.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
{
2-
"editor.formatOnSave": true,
3-
"prettier.eslintIntegration": true,
4-
"eslint.validate": [
5-
"javascript",
6-
"typescript"
7-
]
8-
}
2+
"eslint.validate": ["javascript", "typescript"]
3+
}

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module.exports = {
33
testEnvironment: 'jsdom',
44
automock: false,
55
setupFiles: ['./test/setupJest.ts'],
6+
modulePaths: ['<rootDir>'],
67
};

package-lock.json

+58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"watch": "tsc -w",
2828
"test": "jest --verbose",
2929
"lint": "eslint src test --ext js,ts",
30-
"lint:fix": "eslint src test --ext js,ts --fix"
30+
"lint:fix": "lint --fix"
3131
},
3232
"devDependencies": {
3333
"@types/jest": "^26.0.3",
@@ -38,11 +38,13 @@
3838
"eslint-plugin-prettier": "^3.1.4",
3939
"jest": "^26.1.0",
4040
"jest-fetch-mock": "^3.0.3",
41+
"jest-module-name-mapper": "^0.1.5",
4142
"npm-run-all": "^4.1.5",
4243
"prettier": "^2.0.5",
4344
"rimraf": "^3.0.2",
4445
"ts-jest": "^26.1.1",
4546
"tslib": "^2.0.0",
4647
"typescript": "^3.9.5"
47-
}
48+
},
49+
"dependencies": {}
4850
}

src/features/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const wrapPageFeatureGetters = (pageFeatureGetters: IPageFeatureGetter[]) => {
2525

2626
export const getPageFeatures = async (
2727
pageFeatureGetters: IPageFeatureGetter[]
28-
): IPageFeature[] => {
28+
): Promise<IPageFeature[]> => {
2929
const wrappedGetters = wrapPageFeatureGetters(pageFeatureGetters);
3030
const features = await Promise.all(wrappedGetters);
3131
return features;

src/store/audience.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1+
import { StorageKeys, IMatchedAudience } from 'types';
12
import { storage, timeStampInSecs } from '../utils';
2-
import { StorageKeys } from 'types';
3-
4-
export interface IMatchedAudience {
5-
id: string;
6-
matchedAt: number;
7-
expiresAt: number;
8-
matchedOnCurrentPageView: boolean;
9-
}
103

114
class AudienceStore {
125
matchedAudiences: IMatchedAudience[];

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"moduleResolution": "node",
99
"baseUrl": ".",
1010
"paths": {
11-
// "*": ["src/*", "types/*", "node_modules/*"],
1211
"types/*": ["types/*"]
1312
},
1413
"composite": true,

0 commit comments

Comments
 (0)