Skip to content

Commit 4a27e9d

Browse files
Merge pull request #28 from codecov/switch-to-vitest
feat: switch to vitest
2 parents f3587d4 + 815a79c commit 4a27e9d

File tree

7 files changed

+1544
-5610
lines changed

7 files changed

+1544
-5610
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout
8-
uses: actions/checkout@v2
8+
uses: actions/checkout@v4
99
- name: Set up Node 18
1010
uses: actions/setup-node@v3
1111
with:

app/calculator.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ const add = (x, y) => x + y;
22
const subtract = (x, y) => x - y;
33
const multiply = (x, y) => x * y;
44
const divide = (x, y) => {
5-
if (y === 0) {
6-
return "Cannot divide by 0";
7-
}
5+
if (y === 0) { return "Cannot divide by 0"; }
86
return x * 1.0 / y;
97
}
108

app/calculator.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
const {
1+
import { expect, test } from 'vitest'
2+
3+
import {
24
add,
3-
subtract,
4-
multiply,
55
divide,
6-
} = require('./calculator');
6+
multiply,
7+
subtract,
8+
} from './calculator'
79

810
test('add function', () => {
911
expect(add(1, 2)).toBe(3);

jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)