Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(PE-5622): Setup tests and CI #1

Merged
merged 5 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn format:fix
yarn lint
1 change: 0 additions & 1 deletion jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['ts', 'js', 'mjs'],
setupFilesAfterEnv: ['./tests/mocks.jest.ts'],
testMatch: ['**/src/**/*.test.ts', '**/tests/**/*.test.ts'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts', 'tests/**/*.ts'],
Expand Down
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,49 +50,45 @@
"lint:fix": "eslint src --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"test": "c8 mocha --config .mocharc",
"test": "c8 jest .",
"prepare": "husky install",
"example:mjs": "yarn build:esm && node examples/node/index.mjs",
"example:cjs": "yarn build:esm && node examples/node/index.mjs",
"example:web": "yarn build:web && cp -r bundles/* examples/web && http-server --port 8080 --host -o examples/web"
},
"dependencies": {
"jest": "^29.7.0"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.4.8",
"@types/sinon": "^10.0.15",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^6.4.0",
"c8": "^8.0.1",
"chai": "^4.3.7",
"esbuild": "^0.19.2",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard-with-typescript": "^37.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"mocha": "^10.2.0",
"jest": "^29.7.0",
"node-stdlib-browser": "^1.2.0",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"semantic-release": "^21.0.7",
"sinon": "^15.2.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { DefaultClient } from '../src/index.js';
import { DefaultClient } from '../src';

describe('DefaultClient', () => {
it('should create a Default', () => {
const client = new DefaultClient();
expect(client).to.be.instanceOf(DefaultClient);
expect(client).toBeInstanceOf(DefaultClient);
});
});
Loading
Loading