1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Use vitest instead of jest (#50150)

This commit is contained in:
Peter Bengtsson
2024-04-16 13:07:22 -04:00
committed by GitHub
parent e53e71820d
commit e0c8c80982
167 changed files with 1876 additions and 351 deletions

View File

@@ -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'

View File

@@ -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', () => {

View File

@@ -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(() => {

View File

@@ -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')