From e2f059fd099f6e65a0de5ca3ce066ccafb115e41 Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Wed, 11 Dec 2024 07:30:21 -0300 Subject: [PATCH] chore: remove `--platform`, `--node`, `--bun` and `deno` --- benchmark/benchmark.sh | 4 +- src/@types/background-process.ts | 8 +- src/@types/poku.ts | 6 - src/bin/enforce.ts | 4 - src/bin/help.ts | 10 - src/bin/index.ts | 11 - src/builders/assert.ts | 9 - src/modules/helpers/create-service.ts | 2 +- src/parsers/assert.ts | 8 +- src/parsers/get-runtime.ts | 12 +- src/polyfills/object.ts | 32 -- test/c8.test.ts | 14 +- test/ci.test.ts | 5 +- test/e2e/final-results.test.ts | 6 - test/e2e/runners.test.ts | 6 +- test/e2e/watch.test.ts | 9 +- .../assert/assert-no-message.test.ts | 144 ++++---- test/integration/assert/assert.test.ts | 342 +++++++++--------- .../strict/assert-no-message.test.ts | 144 ++++---- test/integration/strict/assert.test.ts | 342 +++++++++--------- test/unit/assert-result-type.test.ts | 17 +- test/unit/deno/allow.test.ts | 8 +- test/unit/deno/cjs.test.ts | 4 +- test/unit/deno/deny.test.ts | 4 - 24 files changed, 509 insertions(+), 642 deletions(-) delete mode 100644 src/polyfills/object.ts diff --git a/benchmark/benchmark.sh b/benchmark/benchmark.sh index 6c1f2bb0..d79ba57e 100644 --- a/benchmark/benchmark.sh +++ b/benchmark/benchmark.sh @@ -21,7 +21,7 @@ echo '```' # Not included in results.json hyperfine -i --warmup 3 \ --command-name 'Node.js' 'node --test "./test/node/**.spec.js"' \ - --command-name "🐷 Poku ($SHORT_SHA)" '../lib/bin/index.js --node ./test/poku' | + --command-name "🐷 Poku ($SHORT_SHA)" '../lib/bin/index.js ./test/poku' | awk '/Summary/ {flag=1} flag' echo '```\n' @@ -31,7 +31,7 @@ echo '```' # Not included in results.json hyperfine -i --warmup 3 \ --command-name 'Bun' 'bun test "test/bun/"' \ - --command-name "🐷 Poku ($SHORT_SHA)" '../lib/bin/index.js --bun ./test/poku' | + --command-name "🐷 Poku ($SHORT_SHA)" 'bun ../lib/bin/index.js ./test/poku' | awk '/Summary/ {flag=1} flag' echo '```\n' diff --git a/src/@types/background-process.ts b/src/@types/background-process.ts index 2d962602..2efd6a2c 100644 --- a/src/@types/background-process.ts +++ b/src/@types/background-process.ts @@ -1,5 +1,4 @@ import type { Runner } from './runner.js'; -import type { Configs } from './poku.js'; type BackgroundProcessOptions = { /** @@ -40,11 +39,6 @@ export type StartScriptOptions = { readonly runner?: Runner; } & BackgroundProcessOptions; -export type StartServiceOptions = { - /** - * By default, Poku will try to identify the actual platform, but you can specify it manually - */ - readonly platform?: Configs['platform']; -} & BackgroundProcessOptions; +export type StartServiceOptions = BackgroundProcessOptions; export type End = (port?: number | number[]) => Promise; diff --git a/src/@types/poku.ts b/src/@types/poku.ts index 25973f30..0fbe6624 100644 --- a/src/@types/poku.ts +++ b/src/@types/poku.ts @@ -35,12 +35,6 @@ export type Configs = { * @default false */ sequential?: boolean; - /** - * Determines the platform for test execution. - * - * @default 'node' - */ - platform?: Runtime; /** * Stops the tests at the first failure. * diff --git a/src/bin/enforce.ts b/src/bin/enforce.ts index 191a63dc..eae06e2b 100644 --- a/src/bin/enforce.ts +++ b/src/bin/enforce.ts @@ -4,11 +4,9 @@ import { format } from '../services/format.js'; export const checkFlags = () => { const allowedFlags = new Set([ - '--bun', '--concurrency', '--config', '--debug', - '--deno', '--denoAllow', '--denoCjs', '--denoDeny', @@ -20,9 +18,7 @@ export const checkFlags = () => { '--killPid', '--killPort', '--killRange', - '--node', '--only', - '--platform', '--quiet', '--sequential', '--watch', diff --git a/src/bin/help.ts b/src/bin/help.ts index 3e37ea7e..90b92ba0 100644 --- a/src/bin/help.ts +++ b/src/bin/help.ts @@ -10,11 +10,9 @@ const options = i('[--options]'); const paths = i('[paths]'); const bullet = d('●'); const summary: [string, string][] = [ - ['--bun', 'Enforce tests to run through Bun.'], ['--concurrency', 'Limit the number of tests running concurrently.'], ['--config, -c', 'Specify a configuration file.'], ['--debug, -d', 'Show detailed logs.'], - ['--deno', 'Enforce tests to run through Deno.'], ['--denoAllow', 'Allow permissions for Deno.'], ['--denoCjs', 'Support CommonJS in Deno.'], ['--denoDeny', 'Deny permissions for Deno.'], @@ -28,9 +26,7 @@ const summary: [string, string][] = [ ['--killPort', 'Terminate the specified ports.'], ['--killRange', 'Terminate the specified port ranges.'], ['--listFiles', 'Display all the files returned in the terminal.'], - ['--node', 'Enforce tests to run through Node.js.'], ['--only', 'Enable selective execution of tests.'], - ['--platform', 'Enforce tests to run through a platform.'], ['--quiet, -q', 'Run tests with no logs.'], ['--sequential', 'Run tests files sequentially.'], ['--version, -v', "Show Poku's installed version."], @@ -49,12 +45,6 @@ const header = ` poku ${options} ${paths} poku ${paths} ${options} -› ${u(b('Ensuring platforms:'))} - - poku ${b('--node')} ${options} ${paths} - poku ${b('--bun')} ${options} ${paths} - poku ${b('--deno')} ${options} ${paths} - › ${u(b('Tips:'))} ${bullet} All CLI options use camel case pattern (e.g.: ${b('--failFast')}). diff --git a/src/bin/index.ts b/src/bin/index.ts index 2a6ecaba..a148aa53 100644 --- a/src/bin/index.ts +++ b/src/bin/index.ts @@ -4,7 +4,6 @@ import type { Configs } from '../@types/poku.js'; import { escapeRegExp } from '../modules/helpers/list-files.js'; import { getArg, getPaths, hasArg, argToArray } from '../parsers/get-arg.js'; import { states } from '../configs/files.js'; -import { platformIsValid } from '../parsers/get-runtime.js'; import { format } from '../services/format.js'; import { kill } from '../modules/helpers/kill.js'; import { envFile } from '../modules/helpers/env.js'; @@ -36,7 +35,6 @@ import { getConfigs } from '../parsers/options.js'; (defaultConfigs?.include ? Array.prototype.concat(defaultConfigs?.include) : ['.']); - const platform = getArg('platform'); const filter = getArg('filter') ?? defaultConfigs?.filter; const exclude = getArg('exclude') ?? defaultConfigs?.exclude; const killPort = getArg('killPort'); @@ -144,15 +142,6 @@ import { getConfigs } from '../parsers/options.js'; } const options: Configs = { - /* c8 ignore next 8 */ // Varies Platform - platform: (() => { - if (platformIsValid(platform)) return platform; - if (hasArg('node')) return 'node'; - if (hasArg('bun')) return 'bun'; - if (hasArg('deno')) return 'deno'; - if (platformIsValid(defaultConfigs?.platform)) - return defaultConfigs.platform; - })(), filter: typeof filter === 'string' ? new RegExp(escapeRegExp(filter)) : filter, exclude: diff --git a/src/builders/assert.ts b/src/builders/assert.ts index e9b732a0..28858855 100644 --- a/src/builders/assert.ts +++ b/src/builders/assert.ts @@ -1,7 +1,6 @@ import type { ProcessAssertionOptions } from '../@types/assert.js'; import type assert from 'node:assert'; import type { AssertPredicate } from 'node:assert'; -import { nodeVersion } from '../parsers/get-runtime.js'; import { processAssert, processAsyncAssert } from '../services/assert.js'; export const createAssert = (nodeAssert: typeof assert) => { @@ -244,10 +243,6 @@ export const createAssert = (nodeAssert: typeof assert) => { regExp: RegExp, message?: ProcessAssertionOptions['message'] ): void => { - /* c8 ignore next 2 */ // Platform version - if (typeof nodeVersion === 'number' && nodeVersion < 12) - throw new Error('match is available from Node.js 12 or higher'); - processAssert(() => nodeAssert?.match(value, regExp), { message, actual: 'Value', @@ -261,10 +256,6 @@ export const createAssert = (nodeAssert: typeof assert) => { regExp: RegExp, message?: ProcessAssertionOptions['message'] ): void => { - /* c8 ignore next 2 */ // Platform version - if (typeof nodeVersion === 'number' && nodeVersion < 12) - throw new Error('doesNotMatch is available from Node.js 12 or higher'); - processAssert(() => nodeAssert.doesNotMatch(value, regExp), { message, actual: 'Value', diff --git a/src/modules/helpers/create-service.ts b/src/modules/helpers/create-service.ts index 28491149..979ba6e3 100644 --- a/src/modules/helpers/create-service.ts +++ b/src/modules/helpers/create-service.ts @@ -147,7 +147,7 @@ export const startService = async ( file: string, options?: StartServiceOptions ): Promise<{ end: End }> => { - const runtimeOptions = runner(file, { platform: options?.platform }); + const runtimeOptions = runner(file); const runtime = runtimeOptions.shift()!; const runtimeArgs = [...runtimeOptions, file]; diff --git a/src/parsers/assert.ts b/src/parsers/assert.ts index 067cdab6..f4508417 100644 --- a/src/parsers/assert.ts +++ b/src/parsers/assert.ts @@ -1,5 +1,3 @@ -import { fromEntries, entries } from '../polyfills/object.js'; - const recurse = (value: unknown): unknown => { if ( typeof value === 'undefined' || @@ -11,9 +9,11 @@ const recurse = (value: unknown): unknown => { return String(value); if (Array.isArray(value)) return value.map(recurse); if (value instanceof Set) return Array.from(value).map(recurse); - if (value instanceof Map) return recurse(fromEntries(value)); + if (value instanceof Map) return recurse(Object.fromEntries(value)); if (value !== null && typeof value === 'object') - return fromEntries(entries(value).map(([key, val]) => [key, recurse(val)])); + return Object.fromEntries( + Object.entries(value).map(([key, val]) => [key, recurse(val)]) + ); return value; }; diff --git a/src/parsers/get-runtime.ts b/src/parsers/get-runtime.ts index 2abb6460..d4532f78 100644 --- a/src/parsers/get-runtime.ts +++ b/src/parsers/get-runtime.ts @@ -6,16 +6,8 @@ declare const Bun: unknown; const regex = /v(\d+)\./; -export const supportedPlatforms: readonly Runtime[] = ['node', 'bun', 'deno']; - -export const platformIsValid = ( - platform: unknown -): platform is (typeof supportedPlatforms)[number] => - typeof platform === 'string' && - supportedPlatforms.indexOf(platform as Runtime) > -1; - -export const getRuntime = (): (typeof supportedPlatforms)[number] => { - if (platformIsValid(env.POKU_RUNTIME)) return env.POKU_RUNTIME; +export const getRuntime = (): Runtime => { + if (env.POKU_RUNTIME) return env.POKU_RUNTIME as Runtime; if (typeof Deno !== 'undefined') return 'deno'; if (typeof Bun !== 'undefined') return 'bun'; diff --git a/src/polyfills/object.ts b/src/polyfills/object.ts deleted file mode 100644 index e8eaaaa3..00000000 --- a/src/polyfills/object.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { nodeVersion } from '../parsers/get-runtime.js'; - -const needsPolyfill = nodeVersion && nodeVersion < 12; - -export const entries = needsPolyfill - ? (obj: { [key: string]: any }): [string, unknown][] => { - const ownProps = Object.keys(obj); - let i = ownProps.length; - const resArray = new Array(i); - - while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]]; - - return resArray; - } - : Object.entries; - -export const fromEntries = needsPolyfill - ? ( - entries: [string, unknown][] | Map - ): Record => { - const mappedEntries = - entries instanceof Map ? Array.from(entries) : entries; - - return mappedEntries.reduce( - (acc, [key, value]) => { - acc[key] = value; - return acc; - }, - {} as Record - ); - } - : Object.fromEntries; diff --git a/test/c8.test.ts b/test/c8.test.ts index 6b2d6095..02f201fd 100644 --- a/test/c8.test.ts +++ b/test/c8.test.ts @@ -14,9 +14,7 @@ test(async () => { await describe('CLI', async () => { await it('Just Touch', async () => { - const results = await inspectPoku( - '--platform=node test/integration/import.test.ts' - ); + const results = await inspectPoku('test/integration/import.test.ts'); console.log(results.stdout); console.log(results.stderr); @@ -25,7 +23,7 @@ test(async () => { }); await it('FILTER Env', async () => { - const results = await inspectPoku('--platform=node test/integration', { + const results = await inspectPoku('test/integration', { env: { ...process.env, FILTER: 'import' }, }); @@ -38,8 +36,8 @@ test(async () => { await it('Options (Just Touch)', async () => { const results = await inspectPoku( isWindows - ? '--concurrency=4 --platform=node --failFast --debug --exclude=".bak" --killPort=4000 --killRange="4000-4001" test/integration/import.test.ts --filter=".test.|.spec."' - : '--concurrency=4 --platform=node --failFast --debug --exclude=.bak --killPort=4000 --killRange=4000-4001 test/integration/import.test.ts --filter=.test.|.spec.' + ? '--concurrency=4 --failFast --debug --exclude=".bak" --killPort=4000 --killRange="4000-4001" test/integration/import.test.ts --filter=".test.|.spec."' + : '--concurrency=4 --failFast --debug --exclude=.bak --killPort=4000 --killRange=4000-4001 test/integration/import.test.ts --filter=.test.|.spec.' ); console.log(results.stdout); @@ -52,7 +50,6 @@ test(async () => { await describe('API', async () => { await it('Single Input', async () => { const exitCode = await poku('test/integration/import.test.ts', { - platform: 'node', noExit: true, }); @@ -61,7 +58,6 @@ test(async () => { await it('Unit (Exclude as Regex)', async () => { const exitCode = await poku('test/unit', { - platform: 'node', exclude: /watch|map-tests/, noExit: true, }); @@ -71,7 +67,6 @@ test(async () => { await it('Unit (Exclude as Array of Regex)', async () => { const exitCode = await poku('test/unit', { - platform: 'node', concurrency: 4, exclude: [/watch/, /map-tests/], noExit: true, @@ -84,7 +79,6 @@ test(async () => { const exitCode = await poku( ['test/unit', 'test/integration', 'test/e2e'], { - platform: 'node', debug: true, filter: /\.(test|spec)\./, failFast: true, diff --git a/test/ci.test.ts b/test/ci.test.ts index 3e2140c1..6e3b0cc1 100644 --- a/test/ci.test.ts +++ b/test/ci.test.ts @@ -11,12 +11,9 @@ test(async () => { const result = await poku(['./test/compatibility'], { debug: true, noExit: true, - platform: 'bun', }); - if (result === 0) { - await compose.down(); - } + if (result === 0) await compose.down(); exit(result); }); diff --git a/test/e2e/final-results.test.ts b/test/e2e/final-results.test.ts index f8c92991..d14a0a42 100644 --- a/test/e2e/final-results.test.ts +++ b/test/e2e/final-results.test.ts @@ -2,12 +2,6 @@ import { describe } from '../../src/modules/helpers/describe.js'; import { it } from '../../src/modules/helpers/it/core.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { inspectPoku } from '../__utils__/capture-cli.test.js'; -import { nodeVersion } from '../../src/parsers/get-runtime.js'; -import { skip } from '../../src/modules/helpers/skip.js'; - -if (nodeVersion && nodeVersion < 12) { - skip(); -} describe('Final Results', async () => { await it('Skip', async () => { diff --git a/test/e2e/runners.test.ts b/test/e2e/runners.test.ts index ad1348fc..f385a1bf 100644 --- a/test/e2e/runners.test.ts +++ b/test/e2e/runners.test.ts @@ -40,7 +40,7 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasNode && (await it('Node.js', async () => { const output = await inspectCLI( - 'npx tsx src/bin/index.ts --platform=node test/__fixtures__/e2e/extensions -d' + 'npx tsx src/bin/index.ts test/__fixtures__/e2e/extensions -d' ); if (output.exitCode !== 0) { @@ -56,7 +56,7 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasBun && (await it('Bun', async () => { const output = await inspectCLI( - 'bun src/bin/index.ts --platform=bun test/__fixtures__/e2e/extensions -d' + 'bun src/bin/index.ts test/__fixtures__/e2e/extensions -d' ); if (output.exitCode !== 0) { @@ -72,7 +72,7 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasDeno && (await it('Deno', async () => { const output = await inspectCLI( - 'deno run --unstable-sloppy-imports --allow-read --allow-env --allow-run src/bin/index.ts --platform=deno test/__fixtures__/e2e/extensions -d --exclude=.cts' + 'deno run --unstable-sloppy-imports --allow-read --allow-env --allow-run src/bin/index.ts test/__fixtures__/e2e/extensions -d --exclude=.cts' ); if (output.exitCode !== 0) { diff --git a/test/e2e/watch.test.ts b/test/e2e/watch.test.ts index f7674e32..456c6f73 100644 --- a/test/e2e/watch.test.ts +++ b/test/e2e/watch.test.ts @@ -1,14 +1,9 @@ -import { getRuntime, nodeVersion } from '../../src/parsers/get-runtime.js'; +import { getRuntime } from '../../src/parsers/get-runtime.js'; import { isBuild, watchCLI } from '../__utils__/capture-cli.test.js'; import { isWindows } from '../../src/parsers/get-runner.js'; import { skip } from '../../src/modules/helpers/skip.js'; -if ( - isBuild || - (nodeVersion && nodeVersion < 10) || - getRuntime() !== 'node' || - isWindows -) { +if (isBuild || getRuntime() !== 'node' || isWindows) { skip(); } diff --git a/test/integration/assert/assert-no-message.test.ts b/test/integration/assert/assert-no-message.test.ts index ae5a93a1..3ed0ed37 100644 --- a/test/integration/assert/assert-no-message.test.ts +++ b/test/integration/assert/assert-no-message.test.ts @@ -90,48 +90,46 @@ describe('Assert Suite (No Message)', () => { }); it(() => { - if (!nodeVersion || nodeVersion > 8) { - const obj = { a: 1 }; + const obj = { a: 1 }; - const functionThatThrows = () => { - throw new Error('Specific error'); - }; + const functionThatThrows = () => { + throw new Error('Specific error'); + }; - it(() => { - assert.throws(() => { - throw new Error('error'); - }); - assert.throws(() => { - throw new Error('Test error'); - }); - assert.throws(() => { - throw new Error('Test error'); - }); - assert.throws(functionThatThrows, new Error('Specific error')); - assert.throws(functionThatThrows, /Specific error/); - assert.throws( - functionThatThrows, - (err) => err instanceof Error && err.message === 'Specific error' - ); + it(() => { + assert.throws(() => { + throw new Error('error'); }); - - it(() => { - assert.doesNotThrow(() => { - obj.a = 2; - }); - assert.strictEqual(obj.a, 2); - assert.doesNotThrow(() => { - return 42; - }); - assert.doesNotThrow(() => - callbackFunction((err) => { - assert.ifError(err); - }) - ); - assert.doesNotThrow(() => 42); - assert.doesNotThrow(() => 'no error'); + assert.throws(() => { + throw new Error('Test error'); }); - } + assert.throws(() => { + throw new Error('Test error'); + }); + assert.throws(functionThatThrows, new Error('Specific error')); + assert.throws(functionThatThrows, /Specific error/); + assert.throws( + functionThatThrows, + (err) => err instanceof Error && err.message === 'Specific error' + ); + }); + + it(() => { + assert.doesNotThrow(() => { + obj.a = 2; + }); + assert.strictEqual(obj.a, 2); + assert.doesNotThrow(() => { + return 42; + }); + assert.doesNotThrow(() => + callbackFunction((err) => { + assert.ifError(err); + }) + ); + assert.doesNotThrow(() => 42); + assert.doesNotThrow(() => 'no error'); + }); }); it(() => { @@ -152,41 +150,39 @@ describe('Assert Suite (No Message)', () => { }); it(() => { - if (!nodeVersion || nodeVersion > 10) { - const asyncFunctionThatRejects = async () => - await Promise.reject(new Error('Async error')); - - const asyncFunctionThatResolves = () => - Promise.resolve('Resolved successfully'); - - const asyncFunctionThatFails = () => - new Promise((_, reject) => reject(new Error('Failed'))); - - const asyncFunctionThatCouldReject = () => - new Promise((resolve) => resolve(undefined)); - - it(() => { - assert.rejects( - async () => await asyncFunctionThatFails(), - new Error('Failed') - ); - assert.rejects(asyncFunctionThatRejects, new Error('Async error')); - assert.rejects( - () => Promise.reject('Simple rejection'), - (err) => err === 'Simple rejection' - ); - assert.rejects(asyncFunctionThatRejects, new Error('Async error')); - }); - - it(() => { - assert.doesNotReject(asyncFunctionThatResolves); - assert.doesNotReject(Promise.resolve('Immediate resolve')); - assert.doesNotReject(asyncFunctionThatCouldReject); - assert.doesNotReject(() => - Promise.resolve('Async function with no rejection') - ); - assert.doesNotReject(asyncFunctionThatResolves); - }); - } + const asyncFunctionThatRejects = async () => + await Promise.reject(new Error('Async error')); + + const asyncFunctionThatResolves = () => + Promise.resolve('Resolved successfully'); + + const asyncFunctionThatFails = () => + new Promise((_, reject) => reject(new Error('Failed'))); + + const asyncFunctionThatCouldReject = () => + new Promise((resolve) => resolve(undefined)); + + it(() => { + assert.rejects( + async () => await asyncFunctionThatFails(), + new Error('Failed') + ); + assert.rejects(asyncFunctionThatRejects, new Error('Async error')); + assert.rejects( + () => Promise.reject('Simple rejection'), + (err) => err === 'Simple rejection' + ); + assert.rejects(asyncFunctionThatRejects, new Error('Async error')); + }); + + it(() => { + assert.doesNotReject(asyncFunctionThatResolves); + assert.doesNotReject(Promise.resolve('Immediate resolve')); + assert.doesNotReject(asyncFunctionThatCouldReject); + assert.doesNotReject(() => + Promise.resolve('Async function with no rejection') + ); + assert.doesNotReject(asyncFunctionThatResolves); + }); }); }); diff --git a/test/integration/assert/assert.test.ts b/test/integration/assert/assert.test.ts index 7ce61784..2789acb2 100644 --- a/test/integration/assert/assert.test.ts +++ b/test/integration/assert/assert.test.ts @@ -138,90 +138,88 @@ describe('Assert Suite', async () => { }); it(() => { - if (!nodeVersion || nodeVersion > 8) { - const obj = { a: 1 }; - - const functionThatThrows = () => { - throw new Error('Specific error'); - }; - - it(() => { - assert.throws(() => { - throw new Error('error'); - }, 'throws with throwing function'); - assert.throws(() => { - throw new Error('Test error'); - }, 'Should throw an exception for a function that generates an error'); - assert.throws(() => { - throw new Error('Test error'); - }, 'Should throw an error for a function that actually throws'); - assert.throws( - functionThatThrows, - new Error('Specific error'), - 'Should throw the specific error' - ); - - assert.throws( - functionThatThrows, - /Specific error/, - 'Should throw an error matching the regex' - ); - - assert.throws( - functionThatThrows, - (err) => err instanceof Error && err.message === 'Specific error', - 'Should throw an error where the message equals the specific string' - ); - }); - - it(() => { - assert.doesNotThrow( - () => 1 + 1, - 'doesNotThrow with non-throwing function' - ); - - assert.doesNotThrow(() => { - obj.a = 2; - }, 'Changing property should not throw'); - assert.strictEqual(obj.a, 2, 'Property a should be 2 after mutation'); - - // Test to check functions that do or do not throw errors - assert.doesNotThrow(() => { - return 42; - }, 'Should not throw an exception for a function returning 42'); - - assert.doesNotThrow( - () => - callbackFunction((err) => { - assert.ifError(err); - }), - 'Should not throw an error for a callback function that does not error' - ); - - assert.doesNotThrow( - () => 42, - 'Should not throw an error for a function returning a number' - ); - - assert.doesNotThrow( - () => 'no error', - 'Should not throw an error for a function returning a string' - ); - - assert.doesNotThrow( - () => 'no error', - 'Should not throw an error for an async function that resolves' - ); - - assert.doesNotThrow( - () => { - return 'test'; - }, - /test/, - 'RegExp predicate should not match' - ); - }); - } + const obj = { a: 1 }; + + const functionThatThrows = () => { + throw new Error('Specific error'); + }; + + it(() => { + assert.throws(() => { + throw new Error('error'); + }, 'throws with throwing function'); + assert.throws(() => { + throw new Error('Test error'); + }, 'Should throw an exception for a function that generates an error'); + assert.throws(() => { + throw new Error('Test error'); + }, 'Should throw an error for a function that actually throws'); + assert.throws( + functionThatThrows, + new Error('Specific error'), + 'Should throw the specific error' + ); + + assert.throws( + functionThatThrows, + /Specific error/, + 'Should throw an error matching the regex' + ); + + assert.throws( + functionThatThrows, + (err) => err instanceof Error && err.message === 'Specific error', + 'Should throw an error where the message equals the specific string' + ); + }); + + it(() => { + assert.doesNotThrow( + () => 1 + 1, + 'doesNotThrow with non-throwing function' + ); + + assert.doesNotThrow(() => { + obj.a = 2; + }, 'Changing property should not throw'); + assert.strictEqual(obj.a, 2, 'Property a should be 2 after mutation'); + + // Test to check functions that do or do not throw errors + assert.doesNotThrow(() => { + return 42; + }, 'Should not throw an exception for a function returning 42'); + + assert.doesNotThrow( + () => + callbackFunction((err) => { + assert.ifError(err); + }), + 'Should not throw an error for a callback function that does not error' + ); + + assert.doesNotThrow( + () => 42, + 'Should not throw an error for a function returning a number' + ); + + assert.doesNotThrow( + () => 'no error', + 'Should not throw an error for a function returning a string' + ); + + assert.doesNotThrow( + () => 'no error', + 'Should not throw an error for an async function that resolves' + ); + + assert.doesNotThrow( + () => { + return 'test'; + }, + /test/, + 'RegExp predicate should not match' + ); + }); }); it(() => { @@ -258,94 +256,92 @@ describe('Assert Suite', async () => { }); await it(async () => { - if (!nodeVersion || nodeVersion > 10) { - const asyncFunctionThatRejects = async () => - await Promise.reject(new Error('Async error')); - - const asyncFunctionThatResolves = () => - Promise.resolve('Resolved successfully'); - - const asyncFunctionThatFails = () => - new Promise((_, reject) => reject(new Error('Failed'))); - - const asyncFunctionThatCouldReject = () => - new Promise((resolve) => resolve(undefined)); - - await it(async () => { - await assert.rejects( - async () => await asyncFunctionThatFails(), - new Error('Failed'), - 'Async function should reject with an error' - ); - await assert.rejects( - asyncFunctionThatRejects, - new Error('Async error'), - 'Should reject with an Error object with "Async error" message' - ); - await assert.rejects( - () => Promise.reject('Simple rejection'), - (err) => err === 'Simple rejection', - 'Should handle rejection with a simple string message' - ); - await assert.rejects( - asyncFunctionThatRejects, - new Error('Async error'), - 'Should reject with the specified error message' - ); - await assert.rejects( - asyncFunctionThatRejects, - /Async error/, - 'Should reject with the specified regex message' - ); - await assert.rejects( - asyncFunctionThatRejects, - { message: 'Async error' }, - 'Should reject with the specified object predicate message' - ); - await assert.rejects( - asyncFunctionThatRejects, - (err: Error) => err.message === 'Async error', - 'Should reject with the specified function predicate message' - ); - await assert.rejects( - asyncFunctionThatRejects, - 'Should reject with the specified string message' - ); - await assert.rejects( - asyncFunctionThatRejects, - // @ts-expect-error invalid second param - undefined, - 'Should reject with the specified string message (third arg)' - ); - await assert.rejects(asyncFunctionThatRejects); - }); - - await it(async () => { - await assert.doesNotReject( - asyncFunctionThatResolves, - 'Should not reject for a function that resolves' - ); - await assert.doesNotReject( - asyncFunctionThatResolves, - 'Should not reject for a function that resolves' - ); - await assert.doesNotReject( - Promise.resolve('Immediate resolve'), - 'Should not reject for an immediately resolving promise' - ); - await assert.doesNotReject( - asyncFunctionThatCouldReject, - 'Should not reject for a function that could reject but resolves instead' - ); - await assert.doesNotReject( - () => Promise.resolve('Async function with no rejection'), - 'Should handle async functions that do not reject' - ); - await assert.doesNotReject( - asyncFunctionThatResolves, - /Resolved successfully/ - ); - }); - } + const asyncFunctionThatRejects = async () => + await Promise.reject(new Error('Async error')); + + const asyncFunctionThatResolves = () => + Promise.resolve('Resolved successfully'); + + const asyncFunctionThatFails = () => + new Promise((_, reject) => reject(new Error('Failed'))); + + const asyncFunctionThatCouldReject = () => + new Promise((resolve) => resolve(undefined)); + + await it(async () => { + await assert.rejects( + async () => await asyncFunctionThatFails(), + new Error('Failed'), + 'Async function should reject with an error' + ); + await assert.rejects( + asyncFunctionThatRejects, + new Error('Async error'), + 'Should reject with an Error object with "Async error" message' + ); + await assert.rejects( + () => Promise.reject('Simple rejection'), + (err) => err === 'Simple rejection', + 'Should handle rejection with a simple string message' + ); + await assert.rejects( + asyncFunctionThatRejects, + new Error('Async error'), + 'Should reject with the specified error message' + ); + await assert.rejects( + asyncFunctionThatRejects, + /Async error/, + 'Should reject with the specified regex message' + ); + await assert.rejects( + asyncFunctionThatRejects, + { message: 'Async error' }, + 'Should reject with the specified object predicate message' + ); + await assert.rejects( + asyncFunctionThatRejects, + (err: Error) => err.message === 'Async error', + 'Should reject with the specified function predicate message' + ); + await assert.rejects( + asyncFunctionThatRejects, + 'Should reject with the specified string message' + ); + await assert.rejects( + asyncFunctionThatRejects, + // @ts-expect-error invalid second param + undefined, + 'Should reject with the specified string message (third arg)' + ); + await assert.rejects(asyncFunctionThatRejects); + }); + + await it(async () => { + await assert.doesNotReject( + asyncFunctionThatResolves, + 'Should not reject for a function that resolves' + ); + await assert.doesNotReject( + asyncFunctionThatResolves, + 'Should not reject for a function that resolves' + ); + await assert.doesNotReject( + Promise.resolve('Immediate resolve'), + 'Should not reject for an immediately resolving promise' + ); + await assert.doesNotReject( + asyncFunctionThatCouldReject, + 'Should not reject for a function that could reject but resolves instead' + ); + await assert.doesNotReject( + () => Promise.resolve('Async function with no rejection'), + 'Should handle async functions that do not reject' + ); + await assert.doesNotReject( + asyncFunctionThatResolves, + /Resolved successfully/ + ); + }); }); }); diff --git a/test/integration/strict/assert-no-message.test.ts b/test/integration/strict/assert-no-message.test.ts index 95c10023..30d642b3 100644 --- a/test/integration/strict/assert-no-message.test.ts +++ b/test/integration/strict/assert-no-message.test.ts @@ -101,48 +101,46 @@ describe('Strict Suite (No Message)', async () => { }); it(() => { - if (!nodeVersion || nodeVersion > 8) { - const obj = { a: 1 }; + const obj = { a: 1 }; - const functionThatThrows = () => { - throw new Error('Specific error'); - }; + const functionThatThrows = () => { + throw new Error('Specific error'); + }; - it(() => { - assert.throws(() => { - throw new Error('error'); - }); - assert.throws(() => { - throw new Error('Test error'); - }); - assert.throws(() => { - throw new Error('Test error'); - }); - assert.throws(functionThatThrows, new Error('Specific error')); - assert.throws(functionThatThrows, /Specific error/); - assert.throws( - functionThatThrows, - (err) => err instanceof Error && err.message === 'Specific error' - ); + it(() => { + assert.throws(() => { + throw new Error('error'); }); - - it(() => { - assert.doesNotThrow(() => { - obj.a = 2; - }); - assert.strictEqual(obj.a, 2); - assert.doesNotThrow(() => { - return 42; - }); - assert.doesNotThrow(() => - callbackFunction((err) => { - assert.ifError(err); - }) - ); - assert.doesNotThrow(() => 42); - assert.doesNotThrow(() => 'no error'); + assert.throws(() => { + throw new Error('Test error'); }); - } + assert.throws(() => { + throw new Error('Test error'); + }); + assert.throws(functionThatThrows, new Error('Specific error')); + assert.throws(functionThatThrows, /Specific error/); + assert.throws( + functionThatThrows, + (err) => err instanceof Error && err.message === 'Specific error' + ); + }); + + it(() => { + assert.doesNotThrow(() => { + obj.a = 2; + }); + assert.strictEqual(obj.a, 2); + assert.doesNotThrow(() => { + return 42; + }); + assert.doesNotThrow(() => + callbackFunction((err) => { + assert.ifError(err); + }) + ); + assert.doesNotThrow(() => 42); + assert.doesNotThrow(() => 'no error'); + }); }); it(() => { @@ -163,41 +161,39 @@ describe('Strict Suite (No Message)', async () => { }); it(() => { - if (!nodeVersion || nodeVersion > 10) { - const asyncFunctionThatRejects = async () => - await Promise.reject(new Error('Async error')); - - const asyncFunctionThatResolves = () => - Promise.resolve('Resolved successfully'); - - const asyncFunctionThatFails = () => - new Promise((_, reject) => reject(new Error('Failed'))); - - const asyncFunctionThatCouldReject = () => - new Promise((resolve) => resolve(undefined)); - - it(() => { - assert.rejects( - async () => await asyncFunctionThatFails(), - new Error('Failed') - ); - assert.rejects(asyncFunctionThatRejects, new Error('Async error')); - assert.rejects( - () => Promise.reject('Simple rejection'), - (err) => err === 'Simple rejection' - ); - assert.rejects(asyncFunctionThatRejects, new Error('Async error')); - }); - - it(() => { - assert.doesNotReject(asyncFunctionThatResolves); - assert.doesNotReject(Promise.resolve('Immediate resolve')); - assert.doesNotReject(asyncFunctionThatCouldReject); - assert.doesNotReject(() => - Promise.resolve('Async function with no rejection') - ); - assert.doesNotReject(asyncFunctionThatResolves); - }); - } + const asyncFunctionThatRejects = async () => + await Promise.reject(new Error('Async error')); + + const asyncFunctionThatResolves = () => + Promise.resolve('Resolved successfully'); + + const asyncFunctionThatFails = () => + new Promise((_, reject) => reject(new Error('Failed'))); + + const asyncFunctionThatCouldReject = () => + new Promise((resolve) => resolve(undefined)); + + it(() => { + assert.rejects( + async () => await asyncFunctionThatFails(), + new Error('Failed') + ); + assert.rejects(asyncFunctionThatRejects, new Error('Async error')); + assert.rejects( + () => Promise.reject('Simple rejection'), + (err) => err === 'Simple rejection' + ); + assert.rejects(asyncFunctionThatRejects, new Error('Async error')); + }); + + it(() => { + assert.doesNotReject(asyncFunctionThatResolves); + assert.doesNotReject(Promise.resolve('Immediate resolve')); + assert.doesNotReject(asyncFunctionThatCouldReject); + assert.doesNotReject(() => + Promise.resolve('Async function with no rejection') + ); + assert.doesNotReject(asyncFunctionThatResolves); + }); }); }); diff --git a/test/integration/strict/assert.test.ts b/test/integration/strict/assert.test.ts index d1ad5a0d..a7e244f0 100644 --- a/test/integration/strict/assert.test.ts +++ b/test/integration/strict/assert.test.ts @@ -146,90 +146,88 @@ describe('Strict Suite', async () => { }); it(() => { - if (!nodeVersion || nodeVersion > 8) { - const obj = { a: 1 }; - - const functionThatThrows = () => { - throw new Error('Specific error'); - }; - - it(() => { - assert.throws(() => { - throw new Error('error'); - }, 'throws with throwing function'); - assert.throws(() => { - throw new Error('Test error'); - }, 'Should throw an exception for a function that generates an error'); - assert.throws(() => { - throw new Error('Test error'); - }, 'Should throw an error for a function that actually throws'); - assert.throws( - functionThatThrows, - new Error('Specific error'), - 'Should throw the specific error' - ); - - assert.throws( - functionThatThrows, - /Specific error/, - 'Should throw an error matching the regex' - ); - - assert.throws( - functionThatThrows, - (err) => err instanceof Error && err.message === 'Specific error', - 'Should throw an error where the message equals the specific string' - ); - }); - - it(() => { - assert.doesNotThrow( - () => 1 + 1, - 'doesNotThrow with non-throwing function' - ); - - assert.doesNotThrow(() => { - obj.a = 2; - }, 'Changing property should not throw'); - assert.strictEqual(obj.a, 2, 'Property a should be 2 after mutation'); - - // Test to check functions that do or do not throw errors - assert.doesNotThrow(() => { - return 42; - }, 'Should not throw an exception for a function returning 42'); - - assert.doesNotThrow( - () => - callbackFunction((err) => { - assert.ifError(err); - }), - 'Should not throw an error for a callback function that does not error' - ); - - assert.doesNotThrow( - () => 42, - 'Should not throw an error for a function returning a number' - ); - - assert.doesNotThrow( - () => 'no error', - 'Should not throw an error for a function returning a string' - ); - - assert.doesNotThrow( - () => 'no error', - 'Should not throw an error for an async function that resolves' - ); - - assert.doesNotThrow( - () => { - return 'test'; - }, - /test/, - 'RegExp predicate should not match' - ); - }); - } + const obj = { a: 1 }; + + const functionThatThrows = () => { + throw new Error('Specific error'); + }; + + it(() => { + assert.throws(() => { + throw new Error('error'); + }, 'throws with throwing function'); + assert.throws(() => { + throw new Error('Test error'); + }, 'Should throw an exception for a function that generates an error'); + assert.throws(() => { + throw new Error('Test error'); + }, 'Should throw an error for a function that actually throws'); + assert.throws( + functionThatThrows, + new Error('Specific error'), + 'Should throw the specific error' + ); + + assert.throws( + functionThatThrows, + /Specific error/, + 'Should throw an error matching the regex' + ); + + assert.throws( + functionThatThrows, + (err) => err instanceof Error && err.message === 'Specific error', + 'Should throw an error where the message equals the specific string' + ); + }); + + it(() => { + assert.doesNotThrow( + () => 1 + 1, + 'doesNotThrow with non-throwing function' + ); + + assert.doesNotThrow(() => { + obj.a = 2; + }, 'Changing property should not throw'); + assert.strictEqual(obj.a, 2, 'Property a should be 2 after mutation'); + + // Test to check functions that do or do not throw errors + assert.doesNotThrow(() => { + return 42; + }, 'Should not throw an exception for a function returning 42'); + + assert.doesNotThrow( + () => + callbackFunction((err) => { + assert.ifError(err); + }), + 'Should not throw an error for a callback function that does not error' + ); + + assert.doesNotThrow( + () => 42, + 'Should not throw an error for a function returning a number' + ); + + assert.doesNotThrow( + () => 'no error', + 'Should not throw an error for a function returning a string' + ); + + assert.doesNotThrow( + () => 'no error', + 'Should not throw an error for an async function that resolves' + ); + + assert.doesNotThrow( + () => { + return 'test'; + }, + /test/, + 'RegExp predicate should not match' + ); + }); }); it(() => { @@ -266,94 +264,92 @@ describe('Strict Suite', async () => { }); await it(async () => { - if (!nodeVersion || nodeVersion > 10) { - const asyncFunctionThatRejects = async () => - await Promise.reject(new Error('Async error')); - - const asyncFunctionThatResolves = () => - Promise.resolve('Resolved successfully'); - - const asyncFunctionThatFails = () => - new Promise((_, reject) => reject(new Error('Failed'))); - - const asyncFunctionThatCouldReject = () => - new Promise((resolve) => resolve(undefined)); - - await it(async () => { - await assert.rejects( - async () => await asyncFunctionThatFails(), - new Error('Failed'), - 'Async function should reject with an error' - ); - await assert.rejects( - asyncFunctionThatRejects, - new Error('Async error'), - 'Should reject with an Error object with "Async error" message' - ); - await assert.rejects( - () => Promise.reject('Simple rejection'), - (err) => err === 'Simple rejection', - 'Should handle rejection with a simple string message' - ); - await assert.rejects( - asyncFunctionThatRejects, - new Error('Async error'), - 'Should reject with the specified error message' - ); - await assert.rejects( - asyncFunctionThatRejects, - /Async error/, - 'Should reject with the specified regex message' - ); - await assert.rejects( - asyncFunctionThatRejects, - { message: 'Async error' }, - 'Should reject with the specified object predicate message' - ); - await assert.rejects( - asyncFunctionThatRejects, - (err: Error) => err.message === 'Async error', - 'Should reject with the specified function predicate message' - ); - await assert.rejects( - asyncFunctionThatRejects, - 'Should reject with the specified string message' - ); - await assert.rejects( - asyncFunctionThatRejects, - // @ts-expect-error invalid second param - undefined, - 'Should reject with the specified string message (third arg)' - ); - await assert.rejects(asyncFunctionThatRejects); - }); - - await it(async () => { - await assert.doesNotReject( - asyncFunctionThatResolves, - 'Should not reject for a function that resolves' - ); - await assert.doesNotReject( - asyncFunctionThatResolves, - 'Should not reject for a function that resolves' - ); - await assert.doesNotReject( - Promise.resolve('Immediate resolve'), - 'Should not reject for an immediately resolving promise' - ); - await assert.doesNotReject( - asyncFunctionThatCouldReject, - 'Should not reject for a function that could reject but resolves instead' - ); - await assert.doesNotReject( - () => Promise.resolve('Async function with no rejection'), - 'Should handle async functions that do not reject' - ); - await assert.doesNotReject( - asyncFunctionThatResolves, - /Resolved successfully/ - ); - }); - } + const asyncFunctionThatRejects = async () => + await Promise.reject(new Error('Async error')); + + const asyncFunctionThatResolves = () => + Promise.resolve('Resolved successfully'); + + const asyncFunctionThatFails = () => + new Promise((_, reject) => reject(new Error('Failed'))); + + const asyncFunctionThatCouldReject = () => + new Promise((resolve) => resolve(undefined)); + + await it(async () => { + await assert.rejects( + async () => await asyncFunctionThatFails(), + new Error('Failed'), + 'Async function should reject with an error' + ); + await assert.rejects( + asyncFunctionThatRejects, + new Error('Async error'), + 'Should reject with an Error object with "Async error" message' + ); + await assert.rejects( + () => Promise.reject('Simple rejection'), + (err) => err === 'Simple rejection', + 'Should handle rejection with a simple string message' + ); + await assert.rejects( + asyncFunctionThatRejects, + new Error('Async error'), + 'Should reject with the specified error message' + ); + await assert.rejects( + asyncFunctionThatRejects, + /Async error/, + 'Should reject with the specified regex message' + ); + await assert.rejects( + asyncFunctionThatRejects, + { message: 'Async error' }, + 'Should reject with the specified object predicate message' + ); + await assert.rejects( + asyncFunctionThatRejects, + (err: Error) => err.message === 'Async error', + 'Should reject with the specified function predicate message' + ); + await assert.rejects( + asyncFunctionThatRejects, + 'Should reject with the specified string message' + ); + await assert.rejects( + asyncFunctionThatRejects, + // @ts-expect-error invalid second param + undefined, + 'Should reject with the specified string message (third arg)' + ); + await assert.rejects(asyncFunctionThatRejects); + }); + + await it(async () => { + await assert.doesNotReject( + asyncFunctionThatResolves, + 'Should not reject for a function that resolves' + ); + await assert.doesNotReject( + asyncFunctionThatResolves, + 'Should not reject for a function that resolves' + ); + await assert.doesNotReject( + Promise.resolve('Immediate resolve'), + 'Should not reject for an immediately resolving promise' + ); + await assert.doesNotReject( + asyncFunctionThatCouldReject, + 'Should not reject for a function that could reject but resolves instead' + ); + await assert.doesNotReject( + () => Promise.resolve('Async function with no rejection'), + 'Should handle async functions that do not reject' + ); + await assert.doesNotReject( + asyncFunctionThatResolves, + /Resolved successfully/ + ); + }); }); }); diff --git a/test/unit/assert-result-type.test.ts b/test/unit/assert-result-type.test.ts index d52edf31..f16bcdaa 100644 --- a/test/unit/assert-result-type.test.ts +++ b/test/unit/assert-result-type.test.ts @@ -1,7 +1,6 @@ import { test } from '../../src/modules/helpers/test.js'; import { assert } from '../../src/modules/essentials/assert.js'; import { parseResultType } from '../../src/parsers/assert.js'; -import { nodeVersion } from '../../src/parsers/get-runtime.js'; test('Assert: Parse Result Type', async () => { assert.deepStrictEqual( @@ -32,14 +31,14 @@ test('Assert: Parse Result Type', async () => { 'String (Multi Line/Table)' ); assert.deepStrictEqual(parseResultType(123), '123', 'Number'); - if (!nodeVersion || nodeVersion >= 10) { - const module = await import('../__fixtures__/unit/sintax/big-int.js'); - assert.deepStrictEqual( - parseResultType(module.bigIntValue), - '987456321456987456321', - 'Big Int' - ); - } + + const module = await import('../__fixtures__/unit/sintax/big-int.js'); + assert.deepStrictEqual( + parseResultType(module.bigIntValue), + '987456321456987456321', + 'Big Int' + ); + assert.deepStrictEqual(parseResultType(/123/), '/123/', 'Regex'); assert(/=>/.test(parseResultType(() => {})), 'Anonymous Function'); diff --git a/test/unit/deno/allow.test.ts b/test/unit/deno/allow.test.ts index 66fccf2c..ccddea4b 100644 --- a/test/unit/deno/allow.test.ts +++ b/test/unit/deno/allow.test.ts @@ -12,9 +12,7 @@ if (runtime !== 'deno') { test('Deno Permissions (Allow)', () => { assert.deepStrictEqual( - runner('', { - platform: 'deno', - }), + runner('', {}), [ 'deno', 'run', @@ -28,7 +26,6 @@ test('Deno Permissions (Allow)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: ['read'], }, @@ -39,7 +36,6 @@ test('Deno Permissions (Allow)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: ['read', 'env'], }, @@ -50,7 +46,6 @@ test('Deno Permissions (Allow)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: ['read=file.js', 'env'], }, @@ -61,7 +56,6 @@ test('Deno Permissions (Allow)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: [], }, diff --git a/test/unit/deno/cjs.test.ts b/test/unit/deno/cjs.test.ts index b5834196..9f1946cb 100644 --- a/test/unit/deno/cjs.test.ts +++ b/test/unit/deno/cjs.test.ts @@ -12,12 +12,12 @@ if (runtime !== 'deno') { } test('Deno Compatibility', async () => { - const FILE = 'test/__fixtures__/integration/deno/require.cjs'; + const POKU_FILE = 'test/__fixtures__/integration/deno/require.cjs'; const polyfillPath = './lib/polyfills/deno.mjs'; const command = 'deno'; const args = ['run', '--allow-env', '--allow-read', polyfillPath]; - const env = { ...process.env, FILE }; + const env = { ...process.env, POKU_FILE }; const denoProcess = spawn(command, args, { env }); diff --git a/test/unit/deno/deny.test.ts b/test/unit/deno/deny.test.ts index f584d9d7..934bdb84 100644 --- a/test/unit/deno/deny.test.ts +++ b/test/unit/deno/deny.test.ts @@ -13,7 +13,6 @@ if (runtime !== 'deno') { test('Deno Permissions (Deny)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: [], deny: ['read'], @@ -25,7 +24,6 @@ test('Deno Permissions (Deny)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: [], deny: ['read', 'env'], @@ -37,7 +35,6 @@ test('Deno Permissions (Deny)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: [], deny: ['read=file.js', 'env'], @@ -49,7 +46,6 @@ test('Deno Permissions (Deny)', () => { assert.deepStrictEqual( runner('', { - platform: 'deno', deno: { allow: ['read=file.js', 'net'], deny: ['net=server.com', 'env'],