Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Add WPT runner
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Mar 12, 2021
1 parent 0247851 commit 770a58d
Show file tree
Hide file tree
Showing 4 changed files with 713 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/common/fixtures.js
@@ -0,0 +1,33 @@
/* eslint-disable node-core/require-common-first, node-core/required-modules */
'use strict';

const path = require('path');
const fs = require('fs');

const fixturesDir = path.join(__dirname, '..', 'fixtures');

function fixturesPath(...args) {
return path.join(fixturesDir, ...args);
}

function readFixtureSync(args, enc) {
if (Array.isArray(args))
return fs.readFileSync(fixturesPath(...args), enc);
return fs.readFileSync(fixturesPath(args), enc);
}

function readFixtureKey(name, enc) {
return fs.readFileSync(fixturesPath('keys', name), enc);
}

function readFixtureKeys(enc, ...names) {
return names.map((name) => readFixtureKey(name, enc));
}

module.exports = {
fixturesDir,
path: fixturesPath,
readSync: readFixtureSync,
readKey: readFixtureKey,
readKeys: readFixtureKeys,
};
4 changes: 4 additions & 0 deletions test/common/index.js
@@ -0,0 +1,4 @@
'use strict';

exports.hasIntl = true;

0 comments on commit 770a58d

Please sign in to comment.