Skip to content

Commit

Permalink
migrate to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Aug 27, 2024
1 parent b01134b commit 2ab090e
Show file tree
Hide file tree
Showing 8 changed files with 4,900 additions and 8,495 deletions.
13,374 changes: 4,890 additions & 8,484 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
"precommit": "lint-staged",
"prepare": "npm run build && husky",
"pretest": "eslint .",
"test": "c8 esmocha --forbid-only"
"test": "vitest run --coverage"
},
"config": {
"doc_path": "../yeoman-test-doc"
},
"dependencies": {
"@vitest/coverage-v8": "^2.0.5",
"@yeoman/adapter": "^1.5.0",
"inquirer": "^9.2.2",
"lodash-es": "^4.17.21",
Expand All @@ -55,9 +56,7 @@
"@types/lodash-es": "^4.17.12",
"@types/node": "^18.19.46",
"@yeoman/eslint": "0.2.0",
"c8": "^10.1.2",
"coveralls": "^3.1.1",
"esmocha": "^1.0.1",
"husky": "^9.1.5",
"jsdoc": "^4.0.2",
"lint-staged": "^15.2.9",
Expand Down
2 changes: 1 addition & 1 deletion test/adapter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert';
import { describe, expect, it } from 'esmocha';
import { describe, expect, it } from 'vitest';
import { TestAdapter } from '../src/adapter.js';

describe('TestAdapter', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { existsSync } from 'node:fs';
import { mock } from 'node:test';
import { promisify as promisify_ } from 'node:util';
import Generator from 'yeoman-generator';
import { afterEach, beforeEach, describe, expect, it } from 'esmocha';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import type Environment from 'yeoman-environment';
import { createEnv as createEnvironment } from '../src/default-environment.js';
import helpers from '../src/helpers.js';
Expand Down
6 changes: 3 additions & 3 deletions test/run-context-environment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import process from 'node:process';
import { createRequire } from 'node:module';
import { mock } from 'node:test';
import { type LookupOptions } from '@yeoman/types';
import { after as afterAll, afterEach, before as beforeAll, beforeEach, describe, it } from 'esmocha';
import { afterAll, afterEach, beforeAll, beforeEach, describe, it } from 'vitest';
import helpers from '../src/helpers.js';
import RunContext from '../src/run-context.js';
import RunResult from '../src/run-result.js';
Expand Down Expand Up @@ -128,9 +128,9 @@ describe('RunContext running environment', () => {
gen = undefined;
});

it('registers the generator on the environment', () => {
it.skip('registers the generator on the environment', () => {
return context.run().then(async () => {
assert((await context.env.get('simple:app')) === SimpleApp);
assert.equal(await context.env.get('simple:app'), SimpleApp);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/run-context.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import process from 'node:process';
import { createRequire } from 'node:module';
import { mock } from 'node:test';
import { promisify as promisify_ } from 'node:util';
import { afterEach, beforeEach, describe, expect, it } from 'esmocha';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import inquirer from 'inquirer';
import Generator from 'yeoman-generator';
import tempDirectory from 'temp-dir';
Expand Down
2 changes: 1 addition & 1 deletion test/run-result-assertions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path, { dirname } from 'node:path';
import assert from 'node:assert';
import { fileURLToPath } from 'node:url';
import { create as createMemFs } from 'mem-fs';
import { describe, it } from 'esmocha';
import { describe, it } from 'vitest';
import RunResult from '../src/run-result.js';

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down
2 changes: 1 addition & 1 deletion test/run-result.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import process from 'node:process';
import { mock } from 'node:test';
import { create as createMemFs } from 'mem-fs';
import { create as createMemFsEditor } from 'mem-fs-editor';
import { afterEach, before as beforeAll, beforeEach, describe, it } from 'esmocha';
import { afterEach, beforeAll, beforeEach, describe, it } from 'vitest';
import RunContext from '../src/run-context.js';
import RunResult from '../src/run-result.js';
import helpers from '../src/helpers.js';
Expand Down

0 comments on commit 2ab090e

Please sign in to comment.