-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: switch to vitest from jest (#1342)
* chore: swtich to vitest from jest * fix * upates * fix: duplicate web components * enable skip lib check * fix * fix: tweak e2e testing on github action * add debugging * disable assertions
- Loading branch information
Showing
191 changed files
with
8,299 additions
and
10,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
dist | ||
./jest.config.js | ||
./jest.e2e.config.js | ||
./api-extractor.json | ||
./test/fixtures | ||
./types | ||
shim.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,6 @@ debug.log | |
.eslintcache | ||
**/.vitepress/cache | ||
|
||
# jest dump files | ||
report*.json | ||
|
||
*.log | ||
*.swp | ||
*.tgz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { getText } from '../helper' | ||
;['composition', 'legacy'].forEach(pattern => { | ||
describe(`${pattern}`, () => { | ||
beforeAll(async () => { | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/${pattern}/basic.html` | ||
) | ||
}) | ||
|
||
test('initial rendering', async () => { | ||
expect(await getText(page, 'label')).toMatch('言語') | ||
expect(await getText(page, 'p')).toMatch('こんにちは、vue-i18n-bridge!') | ||
}) | ||
|
||
test('change locale', async () => { | ||
await page.selectOption('#app select', 'en') | ||
expect(await getText(page, 'label')).toMatch('Language') | ||
expect(await getText(page, 'p')).toMatch('hello, vue-i18n-bridge!') | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...bridge/components/datetime-format.test.js → ...bridge/components/datetime-format.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import { getText } from '../../helper' | ||
describe(`bridge: datetime format component`, () => { | ||
beforeAll(async () => { | ||
await page.emulateTimezone('UTC') | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/composition/components/datetime-format.html` | ||
) | ||
}) | ||
|
||
test('rendering', async () => { | ||
await expect(page).toMatch( | ||
expect(await getText(page, '#app p.p1')).toMatch( | ||
/([1-9]|1[0-2])\/([1-9]|[12]\d|3[01])\/([12]\d{3})/ | ||
) | ||
await expect(page).toMatch( | ||
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (AM|PM)/ | ||
expect(await getText(page, '#app p.p2')).toMatch( | ||
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9])\u202f(AM|PM)/ | ||
) | ||
await expect(page).toMatch( | ||
expect(await getText(page, '#app p.p3')).toMatch( | ||
/令和([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3][0-9])日(月|火|水|木|金|土|日)曜日 (午前|午後)([0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) 協定世界時/ | ||
) | ||
await expect(page).toMatch( | ||
/R([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3][0-9])日(月|火|水|木|金|土|日)曜日 (午前|午後)([0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) 協定世界時/ | ||
expect(await getText(page, '#app span.p4')).toMatch( | ||
/([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3][0-9])日(月|火|水|木|金|土|日)曜日 (午前|午後)([0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) 協定世界時/ | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { getText } from '../../helper' | ||
describe(`bridge: number format component`, () => { | ||
beforeAll(async () => { | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/composition/components/number-format.html` | ||
) | ||
}) | ||
|
||
test('rendering', async () => { | ||
expect(await getText(page, '#app p.p1')).toMatch('100') | ||
expect(await getText(page, '#app p.p2')).toMatch('$100.00') | ||
expect(await getText(page, '#app p.p3')).toMatch('¥100') | ||
expect(await getText(page, '#app div.slot')).toMatch('€1,234.00') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { getText } from '../../helper' | ||
describe(`bridge: translation component`, () => { | ||
beforeAll(async () => { | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/composition/components/translation.html` | ||
) | ||
}) | ||
|
||
test('rendering', async () => { | ||
expect(await getText(page, '#app p.name')).toMatch('こんにちは、kazupon!') | ||
expect(await getText(page, '#app p.list')).toMatch('hello, English!') | ||
expect(await getText(page, '#app p.linked')).toMatch( | ||
'こんにちは、かずぽん! ごきげんいかが?' | ||
) | ||
expect(await getText(page, '#app p.plural')).toMatch('no bananas') | ||
}) | ||
|
||
test('change quantity', async () => { | ||
await page.selectOption('#app select', '1') | ||
expect(await getText(page, '#app p.plural')).toMatch('1 banana') | ||
await page.selectOption('#app select', '2') | ||
expect(await getText(page, '#app p.plural')).toMatch('2 bananas') | ||
await page.selectOption('#app select', '0') | ||
expect(await getText(page, '#app p.plural')).toMatch('no bananas') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { getText } from '../helper' | ||
;['composition', 'legacy'].forEach(pattern => { | ||
describe(`${pattern}`, () => { | ||
beforeAll(async () => { | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/${pattern}/plural.html` | ||
) | ||
}) | ||
|
||
test('initial rendering', async () => { | ||
expect(await getText(page, '#app p.p1')).toMatch('car') | ||
expect(await getText(page, '#app p.p2')).toMatch('cars') | ||
expect(await getText(page, '#app p.p3')).toMatch('no apples') | ||
expect(await getText(page, '#app p.p4')).toMatch('one apple') | ||
expect(await getText(page, '#app p.p5')).toMatch('10 apples') | ||
expect(await getText(page, '#app p.p7')).toMatch('1 banana') | ||
expect(await getText(page, '#app p.p9')).toMatch('too many bananas') | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { getText } from '../../helper' | ||
;['composition', 'legacy'].forEach(pattern => { | ||
describe(`${pattern}`, () => { | ||
beforeAll(async () => { | ||
await page.goto( | ||
`http://localhost:8080/examples/bridge/${pattern}/scope/global.html` | ||
) | ||
}) | ||
|
||
test('initial rendering', async () => { | ||
expect(await getText(page, '#app p.parent')).toMatch('こんにちは、世界!') | ||
expect(await getText(page, '#app p.child')).toMatch('こんにちは!') | ||
expect(await getText(page, '#app p.sub-child')).toMatch('こんにちは!') | ||
}) | ||
|
||
test('change locale', async () => { | ||
await page.selectOption('#app select', 'en') | ||
expect(await getText(page, '#app p.parent')).toMatch('hello world!') | ||
expect(await getText(page, '#app p.child')).toMatch('Hi !') | ||
expect(await getText(page, '#app p.sub-child')).toMatch('Hi !') | ||
|
||
await page.selectOption('#app div.sub-child select', 'ja') | ||
expect(await getText(page, '#app p.parent')).toMatch('こんにちは、世界!') | ||
expect(await getText(page, '#app p.child')).toMatch('こんにちは!') | ||
expect(await getText(page, '#app p.sub-child')).toMatch('こんにちは!') | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.