Skip to content

Commit

Permalink
test: migrate to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Jan 25, 2024
1 parent 8b20ca6 commit cb77e71
Show file tree
Hide file tree
Showing 17 changed files with 1,989 additions and 1,248 deletions.
11 changes: 0 additions & 11 deletions .c8rc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: npm run lint:check

- name: Test
run: npx c8 npm run test
run: npm run test -- --coverage

- uses: actions/upload-artifact@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: npm run lint:check

- name: Test
run: npx c8 npm run test
run: npm run test -- --coverage

- uses: actions/upload-artifact@master
with:
Expand Down
4 changes: 2 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
'*.{ts,tsx}': [
'(src|__tests__|__mocks__|__helpers__)/**/*.{ts,tsx,js}': [
'eslint --max-warnings=0',
'prettier --write',
]
}
};
13 changes: 0 additions & 13 deletions .mocharc.json

This file was deleted.

11 changes: 11 additions & 0 deletions .run/All Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests" type="JavaScriptTestRunnerVitest" nameIsGenerated="true">
<node-interpreter value="project" />
<vitest-package value="$PROJECT_DIR$/node_modules/vitest" />
<working-dir value="$PROJECT_DIR$" />
<vitest-options value="--watch" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
14 changes: 0 additions & 14 deletions .run/Run all.run.xml

This file was deleted.

17 changes: 0 additions & 17 deletions __helpers__/loader.js

This file was deleted.

13 changes: 0 additions & 13 deletions __helpers__/root-hooks.ts

This file was deleted.

10 changes: 10 additions & 0 deletions __helpers__/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import chai from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import { afterAll } from 'vitest';

chai.use(sinonChai);

afterAll(() => {
sinon.restore();
});
4 changes: 0 additions & 4 deletions __helpers__/sinon-chai.ts

This file was deleted.

1 change: 1 addition & 0 deletions __tests__/manager-stream.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from 'chai';
import sinon from 'sinon';
import { describe, it, afterEach } from 'vitest';
import type Manager from '@src/manager';
import ManagerStream from '@src/manager-stream';

Expand Down
1 change: 1 addition & 0 deletions __tests__/wakeup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from 'chai';
import { describe, it } from 'vitest';
import wakeup from '@src/wakeup';

describe('wakeup', () => {
Expand Down
Loading

0 comments on commit cb77e71

Please sign in to comment.