Skip to content

Commit

Permalink
integration.js: switch to top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 28, 2023
1 parent 8470fe8 commit 3de748a
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tests/integration.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

import process from 'node:process';
import { find, findAsync } from '../index.js';

const expectedUnused = [
Expand All @@ -12,7 +11,6 @@ const expectedUnused = [
'$nestNestedVar',
'$enabled-variable'
];

const ignore = ['$ignored-variable'];
const ignoreFiles = ['**/ignored-file*.scss'];

Expand All @@ -30,20 +28,8 @@ const runTests = (type, result) => {
}
};

try {
const result = find('./tests/', { ignore, ignoreFiles });
runTests('sync', result);
} catch (error) {
console.error(error);
process.exit(1);
}
const resultSync = find('./tests/', { ignore, ignoreFiles });
runTests('sync', resultSync);

(async() => {
try {
const result = await findAsync('./tests/', { ignore, ignoreFiles });
runTests('async', result);
} catch (error) {
console.error(error);
process.exit(1);
}
})();
const resultAsync = await findAsync('./tests/', { ignore, ignoreFiles });
runTests('async', resultAsync);

0 comments on commit 3de748a

Please sign in to comment.