mirror of
https://github.com/symfony/ux-translator.git
synced 2026-03-24 00:12:19 +01:00
Configure Vitest for unit and browser tests (use @puppeteer/browsers and webdriverio)
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
"scripts": {
|
||||
"build": "tsx ../../../bin/build_package.ts .",
|
||||
"watch": "tsx ../../../bin/build_package.ts . --watch",
|
||||
"test": "../../../bin/test_package.sh .",
|
||||
"test": "pnpm run test:unit && pnpm run test:browser",
|
||||
"test:unit": "../../../bin/test_package.sh . --unit",
|
||||
"test:browser": "../../../bin/test_package.sh . --browser",
|
||||
"check": "biome check",
|
||||
"ci": "biome ci"
|
||||
},
|
||||
|
||||
7
assets/test/browser/placeholder.test.ts
Normal file
7
assets/test/browser/placeholder.test.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('Placeholder', () => {
|
||||
it('pass', () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { format } from '../../src/formatters/formatter';
|
||||
import { format } from '../../../src/formatters/formatter';
|
||||
|
||||
describe('Formatter', () => {
|
||||
test.concurrent.each<[string, string, Record<string, string | number>]>([
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { formatIntl } from '../../src/formatters/intl-formatter';
|
||||
import { formatIntl } from '../../../src/formatters/intl-formatter';
|
||||
|
||||
describe('Intl Formatter', () => {
|
||||
test('format with named arguments', () => {
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
setLocaleFallbacks,
|
||||
throwWhenNotFound,
|
||||
trans,
|
||||
} from '../src/translator_controller';
|
||||
} from '../../src/translator_controller';
|
||||
|
||||
describe('Translator', () => {
|
||||
beforeEach(() => {
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { strtr } from '../src/utils';
|
||||
import { strtr } from '../../src/utils';
|
||||
|
||||
describe('Utils', () => {
|
||||
test.concurrent.each<[string, string, Record<string, string>]>([
|
||||
4
assets/vitest.config.browser.mjs
Normal file
4
assets/vitest.config.browser.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
import { mergeConfig } from 'vitest/config';
|
||||
import configShared from '../../../vitest.config.browser.mjs';
|
||||
|
||||
export default mergeConfig(configShared, {});
|
||||
4
assets/vitest.config.unit.mjs
Normal file
4
assets/vitest.config.unit.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
import { mergeConfig } from 'vitest/config';
|
||||
import configShared from '../../../vitest.config.unit.mjs';
|
||||
|
||||
export default mergeConfig(configShared, {});
|
||||
Reference in New Issue
Block a user