Skip to content

Commit

Permalink
spec: Drop outdated version guard (node>=12)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanazuki committed Oct 23, 2023
1 parent 5a1fe9b commit ced1db5
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions spec/example_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,24 @@ const tsExamples = path.join(__dirname, "../examples/*.ts");

const timeout = 10000;

const nodeMajor = Number.parseInt(process.versions.node.split('.')[0]);
if(nodeMajor >= 12) {

describe('JavaScript examples', () => {
for(const file of glob(jsExamples)) {
it(`${file}`, async () => {
await execFile('node', [file], {
cwd: path.join(__dirname, '..'),
timeout,
});
describe('JavaScript examples', () => {
for(const file of glob(jsExamples)) {
it(`${file}`, async () => {
await execFile('node', [file], {
cwd: path.join(__dirname, '..'),
timeout,
});
}
});
});
}
});

describe('TypeScript examples', () => {
for(const file of glob(tsExamples)) {
it(`${file}`, async () => {
await execFile('ts-node', [file], {
cwd: path.join(__dirname, '../examples'),
timeout,
});
describe('TypeScript examples', () => {
for(const file of glob(tsExamples)) {
it(`${file}`, async () => {
await execFile('ts-node', [file], {
cwd: path.join(__dirname, '../examples'),
timeout,
});
}
});

}
});
}
});

0 comments on commit ced1db5

Please sign in to comment.