Use vitest instead of jest (#50150)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { beforeAll } from '@jest/globals'
|
||||
import yaml from 'js-yaml'
|
||||
import { readFileSync } from 'fs'
|
||||
import walk from 'walk-sync'
|
||||
import { extname, basename } from 'path'
|
||||
|
||||
import walk from 'walk-sync'
|
||||
import { beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import { getJsonValidator, validateJson } from '#src/tests/lib/validate-json-schema.js'
|
||||
import { formatAjvErrors } from '#src/tests/helpers/schemas.js'
|
||||
import dataSchemas from '#src/data-directory/lib/data-schemas/index.js'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import filenameToKey from '#src/data-directory/lib/filename-to-key.js'
|
||||
|
||||
describe('filename-to-key', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
import { expect, test, describe, beforeAll, afterAll } from '@jest/globals'
|
||||
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
|
||||
|
||||
import languages from '#src/languages/lib/languages.js'
|
||||
import {
|
||||
@@ -14,7 +14,7 @@ import { DataDirectory } from '#src/tests/helpers/data-directory.js'
|
||||
describe('get-data', () => {
|
||||
let dd
|
||||
const enDirBefore = languages.en.dir
|
||||
// Only `en` is available in jest tests, so pretend we also have Japanese
|
||||
// Only `en` is available in tests, so pretend we also have Japanese
|
||||
languages.ja = Object.assign({}, languages.en, {})
|
||||
|
||||
beforeAll(() => {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { fileURLToPath } from 'url'
|
||||
import path from 'path'
|
||||
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import dataDirectory from '#src/data-directory/lib/data-directory.js'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
const fixturesDir = path.join(__dirname, 'fixtures')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user