Skip to content

Commit

Permalink
chore(setup): added and configured jest in place of mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Feb 9, 2024
1 parent 7383460 commit 467dc7a
Show file tree
Hide file tree
Showing 8 changed files with 2,758 additions and 1,297 deletions.
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"root": true,
"plugins": ["@typescript-eslint", "mocha", "prettier", "header"],
"plugins": ["@typescript-eslint", "jest", "prettier", "header"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:mocha/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"mocha/no-mocha-arrows": "off",
"header/header": ["error", "resources/license.header.js"],
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/strict-boolean-expressions": [
Expand Down
9 changes: 0 additions & 9 deletions .mocharc

This file was deleted.

1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ar-io/core-team
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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'],
testEnvironment: 'node',
testTimeout: 5000,
transform: {
'^.+\\.(ts|js)$': 'ts-jest',
},
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
"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": {},
"dependencies": {
"jest": "^29.7.0"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
Expand Down
2 changes: 0 additions & 2 deletions tests/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { expect } from 'chai';

import { DefaultClient } from '../src/index.js';

describe('DefaultClient', () => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"moduleResolution": "nodenext",
"module": "nodenext",
"alwaysStrict": true,
"types": ["node", "mocha"],
"types": ["node", "jest"],
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"resolveJsonModule": true,
Expand Down
4,020 changes: 2,739 additions & 1,281 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 467dc7a

Please sign in to comment.