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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript-based packages back to integration test run #280

Merged
Merged
Changes from all commits
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
16 changes: 13 additions & 3 deletions test/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ const packages = new Map([
['emittery', 'https://github.com/sindresorhus/emittery'],
['p-queue', 'https://github.com/sindresorhus/p-queue'],
['pretty-bytes', 'https://github.com/sindresorhus/pretty-bytes'],
['normalize-url', 'https://github.com/sindresorhus/normalize-url']
['normalize-url', 'https://github.com/sindresorhus/normalize-url'],
['pageres', 'https://github.com/sindresorhus/pageres'],
['got', 'https://github.com/sindresorhus/got']
]);

const typescriptPackages = new Set([
'pageres',
'got'
]);

const cwd = path.join(__dirname, 'eslint-config-unicorn-tester');
Expand All @@ -57,7 +64,10 @@ const enrichErrors = (packageName, cliArgs, f) => async (...args) => {
};

const makeEslintTask = (packageName, dest, extraArgs = []) => {
const args = ['eslint', '--format', 'json', '--config', path.join(cwd, 'index.js'), dest, ...extraArgs];
const isTypescriptPackage = typescriptPackages.has(packageName);
const typescriptArgs = isTypescriptPackage ? ['--parser', '@typescript-eslint/parser', '--ext', '.ts'] : [];

const args = ['eslint', '--format', 'json', '--config', path.join(cwd, 'index.js'), dest, ...typescriptArgs, ...extraArgs];

return enrichErrors(packageName, args, async () => {
let stdout;
Expand Down Expand Up @@ -127,7 +137,7 @@ const execute = name => {
const list = new Listr([
{
title: 'Setup',
task: () => execa('npm', ['install', '../../..', 'eslint', 'babel-eslint'], {cwd})
task: () => execa('npm', ['install', '../../..', 'eslint', 'babel-eslint', 'typescript', '@typescript-eslint/parser'], {cwd})
},
{
title: 'Integration tests',
Expand Down