Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore(parser): migrate fromjest
tovitest
#10775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
be86f32
676a6e8
c4edfc3
74c34cf
3f4c980
fd48d75
6a54a41
7e0dbde
4a53aeb
d1fde12
c23e047
5b31d33
d20e135
bc70a51
158fe4e
5538fac
793b981
a548c5c
92e872d
94daf56
d0c9582
602bd41
091ca59
9927f4d
c2cf955
7eb7099
ec7ea6d
8a430b4
7da9605
2a78738
d90fde4
fe66cfd
eae45b1
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
{ | ||
"name": "parser", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "library", | ||
"root": "packages/parser", | ||
"sourceRoot": "packages/parser/src", | ||
"targets": { | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"] | ||
}, | ||
"test": { | ||
"executor": "@nx/vite:test" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { createProgram } from '@typescript-eslint/typescript-estree'; | ||
import * as glob from 'glob'; | ||
import fs from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
import type { ParserOptions } from '../../src/parser'; | ||
@@ -15,7 +15,14 @@ import { | ||
// Setup | ||
//------------------------------------------------------------------------------ | ||
const FIXTURES_DIR = path.join( | ||
__dirname, | ||
'..', | ||
'..', | ||
'tests', | ||
'fixtures', | ||
'services', | ||
); | ||
const testFiles = glob.sync(`**/*.src.ts`, { | ||
cwd: FIXTURES_DIR, | ||
}); | ||
@@ -32,18 +39,19 @@ function createConfig(filename: string): ParserOptions { | ||
// Tests | ||
//------------------------------------------------------------------------------ | ||
const program = createProgram(path.resolve(FIXTURES_DIR, 'tsconfig.json')); | ||
describe.for(testFiles)('services', async filename => { | ||
const code = await fs.readFile(path.join(FIXTURES_DIR, filename), { | ||
encoding: 'utf-8', | ||
}); | ||
const config = createConfig(filename); | ||
const snapshotName = formatSnapshotName(filename, FIXTURES_DIR, '.ts'); | ||
aryaemami59 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
it(snapshotName, createSnapshotTestBlock(code, config)); | ||
it(`${snapshotName} services`, () => { | ||
testServices(code, config); | ||
}); | ||
it(`${snapshotName} services with provided program`, () => { | ||
testServices(code, { ...config, program }); | ||
}); | ||
}); |
Uh oh!
There was an error while loading.Please reload this page.