Skip to content

Commit

Permalink
chore: migrate tests to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
pavjacko committed Mar 21, 2022
1 parent 460a392 commit 9a859c0
Show file tree
Hide file tree
Showing 40 changed files with 48 additions and 243 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: 'react-native',
testEnvironment: 'jsdom',
testMatch: ['**/src/**/__tests__/**/*.(js|ts)?(x)', '**/src/**/?(*.)+(spec|test).(js|ts)?(x)'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
transformIgnorePatterns: ['node_modules/(?!([@]?react-native.*|renative|lodash-es)/)'],
modulePathIgnorePatterns: ['lib'],
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"lint": "npx eslint ./packages",
"postinstall": "lerna link --force-local && npx jetify",
"prepare": "husky install",
"test": "lerna run test --stream",
"test": "jest",
"watch": "lerna run --parallel --concurrency 2 watch"
},
"dependencies": {
Expand All @@ -95,9 +95,12 @@
"@babel/runtime": "7.12.5",
"@flexn/typescript": "0.1.4",
"@types/node": "^16.11.7",
"@types/jest": "^27.0.2",
"babel-jest": "26.6.3",
"babel-plugin-module-resolver": "3.2.0",
"babel-plugin-polyfill-corejs2": "0.2.2",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "8.10.0",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-detox": "1.0.0",
Expand All @@ -110,6 +113,7 @@
"eslint-plugin-react-hooks": "4.3.0",
"husky": "^7.0.0",
"jest": "26.6.3",
"ts-jest": "^27.0.7",
"lerna": "4.0.0",
"lint-staged": "12.3.4",
"prettier": "1.17.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-rn-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build:dev": "yarn build --retain-lines",
"build:prod": "babel src -d dist",
"prepublishOnly": "yarn build:clean && yarn build:prod",
"test": "jest -c __tests__/jest.config.js",
"test": "jest",
"build": "yarn clean && yarn compile",
"clean": "rm -rf ./lib && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build:dev": "yarn build --retain-lines",
"build:prod": "babel src -d dist",
"prepublishOnly": "yarn build:clean && yarn build:prod",
"test": "jest -c __tests__/jest.config.js",
"test": "jest",
"build": "yarn clean && yarn compile",
"clean": "rm -rf ./lib && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-preset-rnv/mocks.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function generateMockConfig(cOverride?: {}): any;
//# sourceMappingURL=mocks.d.ts.map
1 change: 1 addition & 0 deletions packages/jest-preset-rnv/mocks.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions packages/rnv/__tests__/integrationTests/emulators.intlinux.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/rnv/__tests__/integrationTests/emulators.intosx.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/rnv/__tests__/jest.config.int.linux.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/rnv/__tests__/jest.config.int.osx.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/rnv/__tests__/jest.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/rnv/__tests__/jest.config.unit.js

This file was deleted.

4 changes: 0 additions & 4 deletions packages/rnv/__tests__/scripts/installPackageManager.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions packages/rnv/__tests__/scripts/resetPath.vbs

This file was deleted.

76 changes: 0 additions & 76 deletions packages/rnv/__tests__/scripts/test.sh

This file was deleted.

1 change: 0 additions & 1 deletion packages/rnv/__tests__/setupTests.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/rnv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"build:dev": "yarn build --retain-lines",
"build:prod": "babel src -d dist",
"prepublishOnly": "yarn build:clean && yarn build:prod",
"test": "jest -c __tests__/jest.config.unit.js",
"test": "jest",
"test:docker": "./__tests__/scripts/test.sh",
"test:integration:linux": "jest -c __tests__/jest.config.int.linux.js",
"test:integration:osx": "jest -c __tests__/jest.config.int.osx.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/rnv/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"./src/**/*.json",
"./types.d.ts",
"./package.json"
],
"exclude": [
"node_modules",
"./src/__tests__"
]
}
6 changes: 0 additions & 6 deletions packages/sdk-android/jest.config.js

This file was deleted.

11 changes: 1 addition & 10 deletions packages/sdk-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@
"inquirer": "8.2.0",
"shelljs": "0.8.5"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"jest": "^27.3.1",
"lint-staged": "12.3.4",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
},
"devDependencies": {},
"peerDependencies": {
"rnv": "^0.36.0-canary.8"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/sdk-android/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

describe('test add function', () => {
it('should return 15 for add(10,5)', () => {
// runner.hello();
// expect(console.log).toBeCalled();
expect(true).toEqual(true);
});
});
4 changes: 4 additions & 0 deletions packages/sdk-android/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"./src/**/*.json",
"./types.d.ts",
"./package.json"
],
"exclude": [
"node_modules",
"./src/__tests__"
]
}
6 changes: 0 additions & 6 deletions packages/sdk-apple/jest.config.js

This file was deleted.

11 changes: 1 addition & 10 deletions packages/sdk-apple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,7 @@
"ios-mobileprovision-finder": "1.0.11",
"shelljs": "0.8.5"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"jest": "^27.3.1",
"lint-staged": "12.3.4",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
},
"devDependencies": {},
"peerDependencies": {
"rnv": "^0.36.0-canary.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-apple/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

describe('test add function', () => {
it('should return 15 for add(10,5)', () => {

expect(true).toEqual(true);
});
});
4 changes: 4 additions & 0 deletions packages/sdk-apple/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"./src/**/*.json",
"./types.d.ts",
"./package.json"
],
"exclude": [
"node_modules",
"./src/__tests__"
]
}
6 changes: 0 additions & 6 deletions packages/sdk-webpack/jest.config.js

This file was deleted.

11 changes: 1 addition & 10 deletions packages/sdk-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,7 @@
"webpack-manifest-plugin": "^4.0.2",
"workbox-webpack-plugin": "^6.4.1"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"jest": "^27.3.1",
"lint-staged": "12.3.4",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
},
"devDependencies": {},
"peerDependencies": {
"rnv": "^0.36.0-canary.8"
},
Expand Down
Loading

0 comments on commit 9a859c0

Please sign in to comment.