Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea2c417

Browse files
committed
Configure Vitest for unit and browser tests (use @puppeteer/browsers and webdriverio)
1 parent 0b19339 commit ea2c417

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"scripts": {
2121
"build": "tsx ../../../bin/build_package.ts .",
2222
"watch": "tsx ../../../bin/build_package.ts . --watch",
23-
"test": "../../../bin/test_package.sh .",
23+
"test": "pnpm run test:unit",
24+
"test:unit": "../../../bin/test_package.sh . --unit",
2425
"check": "biome check",
2526
"ci": "biome ci"
2627
},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { Application, Controller } from '@hotwired/stimulus';
1111
import { getByTestId, getByText, waitFor } from '@testing-library/dom';
1212
import user from '@testing-library/user-event';
1313
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
14-
import { clearDOM, mountDOM } from '../../../../test/stimulus-helpers';
15-
import TogglePasswordController from '../src/controller';
14+
import { clearDOM, mountDOM } from '../../../../../test/stimulus-helpers';
15+
import TogglePasswordController from '../../src/controller';
1616

1717
// Controller used to check the actual controller was properly booted
1818
class CheckController extends Controller {

assets/vitest.config.unit.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { mergeConfig } from 'vitest/config';
2+
import configShared from '../../../vitest.config.unit.mjs';
3+
4+
export default mergeConfig(configShared, {});

0 commit comments

Comments
 (0)