Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: correct execution of test and dev scripts on Windows machines #4926

Merged
merged 4 commits into from May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/types/tools/copy-ast-spec.ts
Expand Up @@ -60,14 +60,16 @@ async function copyFile(
encoding: 'utf-8',
});

await execAsync('yarn', ['prettier', '--write', outpath], {});
await execAsync('yarn', ['prettier', '--write', outpath], {
shell: true,
armano2 marked this conversation as resolved.
Show resolved Hide resolved
});

console.log('Copied', fileName);
}

async function main(): Promise<void> {
// ensure the package is built
await execAsync('yarn', ['build'], { cwd: AST_SPEC_PATH });
await execAsync('yarn', ['build'], { cwd: AST_SPEC_PATH, shell: true });

await Promise.all([
copyFile('dist', 'ast-spec.ts', code =>
Expand Down
Expand Up @@ -92,7 +92,10 @@ class FixturesTester {
return this.fixtures
.map(fixture =>
glob
.sync(`${fixture.directory}/${fixture.pattern}`, {})
.sync(fixture.pattern, {
cwd: fixture.directory,
absolute: true,
})
.map(filename => ({
filename,
ignoreSourceType: fixture.ignoreSourceType,
Expand Down Expand Up @@ -346,7 +349,6 @@ tester.addFixturePatternConfig('typescript/basics', {
/**
* Not yet supported in Babel
* Directive field is not added to module and namespace
* @see https://github.com/babel/babel/issues/9228
*/
'directive-in-module',
'directive-in-namespace',
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/tests/ast-fixtures.test.ts
Expand Up @@ -28,7 +28,7 @@ const FIXTURES_DIR = path.resolve(
const SNAPSHOTS_DIR = path.resolve(__dirname, 'snapshots');

const fixtures = glob
.sync(`${FIXTURES_DIR}/**/*.src.{js,ts,jsx,tsx}`)
.sync(`**/*.src.{js,ts,jsx,tsx}`, { cwd: FIXTURES_DIR, absolute: true })
.map(absolute => {
const relative = path.relative(FIXTURES_DIR, absolute);
const { name, dir, ext } = path.parse(relative);
Expand Down