Skip to content

Commit

Permalink
change print-matrix to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 6, 2022
1 parent 1958647 commit 7cd61fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test-integration/scripts/99-print-matrix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env node
const { writeFileSync, readFileSync } = require('fs');
import { writeFileSync, readFileSync } from 'fs';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const MATRIX_FILE = 'matrix.json';

Expand All @@ -21,7 +26,7 @@ writeFileSync(
.slice(2)
.map(file => {
try {
return require(`../../${file}`).include;
return JSON.parse(readFileSync(join(__dirname, `../../${file}`))).include;
} catch (_) {
console.log(`File ${file} not found`);
return [];
Expand Down

0 comments on commit 7cd61fc

Please sign in to comment.