Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Vitest #1623

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ By default you get the following:
- Shadow DOM v1
- TypeScript
- lit-html
- Karma test runner with headless browser launchers
- Vitest test runner
- Git
- MIT license
- Web Component best practices
Expand Down
37 changes: 0 additions & 37 deletions packages/cli/karma.component.config.js

This file was deleted.

20 changes: 3 additions & 17 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,18 @@
],
"dependencies": {
"@nutmeg/seed": "^0.17.2",
"@types/chai": "4.3.0",
"@types/mocha": "8.0.3",
"@types/sinon": "10.0.11",
"babel-preset-env": "1.7.0",
"chai": "4.3.6",
"commander": "9.0.0",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-firefox-launcher": "2.1.2",
"karma-mocha": "2.0.1",
"karma-opera-launcher": "1.0.0",
"karma-safari-launcher": "1.0.0",
"karma-sinon": "1.0.5",
"karma-typescript": "5.5.3",
"karma-typescript-es6-transform": "5.5.3",
"happy-dom": "^2.45.0",
"lodash.template": "4.5.0",
"mocha": "8.1.3",
"pascal-case": "3.1.2",
"recursive-copy": "2.0.14",
"shelljs": "0.8.5",
"sinon": "13.0.1",
"through2": "4.0.2",
"ts-loader": "9.2.7",
"typescript": "4.2.4",
"update-notifier": "5.1.0"
"update-notifier": "5.1.0",
"vitest": "^0.5.9"
},
"devDependencies": {
"@types/lodash.template": "4.5.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ const program = new Command();
program.command('test <path>', 'test a Web Component').parse(process.argv);

const workingDir = path.resolve(process.cwd(), program.args[0]);
const karmaConfigFile = path.resolve(nutmegDir, 'karma.component.config.js');
const karmaCmd = `karma start ${karmaConfigFile}`;
const vitestCmd = `vitest --watch false --environment happy-dom`;

exit(
"Directory doesn't have a package.json with @nutmeg/seed as a dependancy.",
!isNutmegComponent(workingDir)
);

const result = shell.exec(`npx ${karmaCmd}`);
const result = shell.exec(`npx ${vitestCmd}`);
process.exit(result.code);
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'mocha';
import { expect } from 'chai';
import sinon from 'sinon';
import { beforeEach, describe, expect, it } from 'vitest';

import { <%= name %> } from '../src/<%= tag %>';

Expand Down
32 changes: 0 additions & 32 deletions packages/seed/karma.config.js

This file was deleted.

19 changes: 4 additions & 15 deletions packages/seed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"clean": "rm -rf dist/*",
"prebuild": "npm run clean",
"prepare": "npm run build",
"test": "karma start karma.config.js",
"test": "vitest --watch false --environment happy-dom",
"watch": "tsc --watch"
},
"keywords": [
Expand All @@ -46,21 +46,10 @@
"lit-html": "2.2.0"
},
"devDependencies": {
"@types/chai": "4.3.0",
"@types/mocha": "8.0.3",
"@types/node": "16.11.26",
"chai": "4.3.6",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.0",
"karma-firefox-launcher": "2.1.2",
"karma-mocha": "2.0.1",
"karma-sinon": "1.0.5",
"karma-typescript": "5.5.3",
"karma-typescript-es6-transform": "5.5.3",
"mocha": "8.1.3",
"sinon": "13.0.1",
"typescript": "4.2.4"
"happy-dom": "^2.45.0",
"typescript": "4.2.4",
"vitest": "^0.5.9"
},
"types": "dist/seed.d.ts",
"directories": {
Expand Down
Loading