Skip to content

Commit

Permalink
feat: use 8 as min supported runtime message
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Mar 20, 2020
1 parent 31b92fb commit f6779fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/cli/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { gte } from 'semver';

const MIN_RUNTIME = '6.5.0';
const MIN_RUNTIME = '8.0.0';

export const supportedRange = `>= ${MIN_RUNTIME}`;

export function isSupported(runtimeVersion) {
export function isSupported(runtimeVersion: string): boolean {
return gte(runtimeVersion, MIN_RUNTIME);
}
6 changes: 3 additions & 3 deletions test/runtime.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { test } from 'tap';
import * as runtime from '../src/cli/runtime';

test('nodejs runtime versions support ', (t) => {
test('nodejs runtime versions support ', async (t) => {
t.ok(
runtime.isSupported(process.versions.node),
'Current runtime is supported',
);
t.ok(runtime.isSupported('6.16.0'), '6.16.0 is supported');
t.notOk(runtime.isSupported('6.16.0'), '6.16.0 is not supported');
t.ok(runtime.isSupported('8.0.0'), '8.0.0 is supported');
t.ok(runtime.isSupported('11.0.0-pre'), 'pre-release is supported');
t.notOk(runtime.isSupported('0.10.48'), '0.10 is not supported');
t.notOk(runtime.isSupported('0.12.18'), '0.12 is not supported');
t.notOk(runtime.isSupported('4.0.0'), '4.0.0 is not supported');
t.notOk(runtime.isSupported('6.4.0'), '6.4.0 is not supported');
t.end();
});

0 comments on commit f6779fa

Please sign in to comment.