Skip to content

Commit

Permalink
deps: update astro to the latest. use vitest instead of mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Apr 26, 2024
1 parent 15aea77 commit 142742a
Show file tree
Hide file tree
Showing 21 changed files with 5,492 additions and 4,015 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .mocharc.yml

This file was deleted.

19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-check

import js from '@eslint/js'

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
},
rules: {
"no-unused-vars": "error",
"no-undef": "error"
}
}
];
9,337 changes: 5,414 additions & 3,923 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 15 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,26 @@
"node": ">=20"
},
"scripts": {
"test": "eslint ./src/**/*.js && mocha",
"watch": "chokidar ./src/**/*.[j,t]s -c 'npm test -- --reporter dot'",
"coverage": "nyc mocha --reporter dot",
"test": "eslint ./src/**/*.js && vitest run",
"watch": "chokidar ./src/**/*.[j,t]s -c 'npm test'",
"coverage": "vitest run --coverage",
"stryker": "stryker run",
"dep:major": "npx npm-check-updates --packageFile '**/package.json' -u",
"dep:minor": "npm run dep:major -t minor"
},
"devDependencies": {
"@babel/core": "~7.11.0",
"@babel/preset-env": "~7.11.0",
"@babel/register": "~7.10.5",
"@stryker-mutator/core": "~4.0.0",
"@stryker-mutator/mocha-runner": "~4.0.0",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.0.3",
"@types/node": "^14.14.3",
"chai": "~4.2.0",
"chokidar-cli": "~2.1.0",
"eslint": "~7.6.0",
"mocha": "~8.1.0",
"nyc": "~15.1.0",
"sinon": "~9.0.2",
"stryker-cli": "~1.0.0",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
"@stryker-mutator/core": "~8.2.6",
"@stryker-mutator/vitest-runner": "^8.2.6",
"@types/chai": "^4.3.14",
"@types/node": "^20.12.7",
"@vitest/coverage-istanbul": "^1.5.2",
"chai": "~5.1.0",
"chokidar-cli": "~3.0.0",
"eslint": "~9.1.1",
"sinon": "~17.0.1",
"stryker-cli": "~1.0.2",
"typescript": "^5.4.5",
"vitest": "^1.5.2"
},
"nyc": {
"reporter": [
Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/Doctor.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { Doctor } from './Doctor';

Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/Lady.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { Lady } from './Lady';

Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/Mister.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { Mister } from './Mister';

Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/Person.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { Person } from './Person';

Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/Sir.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { Sir } from './Sir';

Expand Down
2 changes: 2 additions & 0 deletions src/bla-bla-bla/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { app } from './app';

Expand Down
2 changes: 2 additions & 0 deletions src/fizz-buzz/FizzBuzz.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';

import FizzBuzz from './FizzBuzz';
Expand Down
6 changes: 4 additions & 2 deletions src/hello-world/HelloWorld.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect } from 'chai';
import { describe, it } from 'vitest'

import HelloWorld from './HelloWorld';
import { expect } from 'chai'

import HelloWorld from './HelloWorld'

describe('HelloWorld', () => {

Expand Down
2 changes: 2 additions & 0 deletions src/primes/Primes.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';

import Primes from './Primes';
Expand Down
2 changes: 2 additions & 0 deletions src/rock-paper-scissors/rockPaperScissors.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect } from 'chai';
import { stub } from 'sinon';

Expand Down
2 changes: 2 additions & 0 deletions src/sound-player/soundPlayer.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, beforeEach, it } from 'vitest'

import { expect, Assertion } from 'chai';
import { mock } from 'sinon';

Expand Down
6 changes: 4 additions & 2 deletions src/typescript/typescript.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect } from 'chai';
import { it } from 'vitest'

import { helloWorld } from './typescript';
import { expect } from 'chai'

import { helloWorld } from './typescript'

it('can be used', () => {
expect(helloWorld).to.be.eql('Hi all!');
Expand Down
5 changes: 4 additions & 1 deletion stryker.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
packageManager: 'npm',
reporters: ['clear-text', 'progress', 'dashboard', 'html'],
testRunner: 'mocha'
testRunner: 'vitest',
vitest: {
dir: './src/'
}
};
43 changes: 0 additions & 43 deletions test-loader.ts

This file was deleted.

12 changes: 12 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
dir: './src/',
coverage: {
provider: 'istanbul',
reporter: ['text', 'json', 'html', 'lcov', 'text-lcov'],
},
},
})

0 comments on commit 142742a

Please sign in to comment.