|
|
@@ -14,6 +14,7 @@
|
|
|
import { describe, expect, it, vi } from 'vitest'
|
|
|
import { notAvailableError, notImplementedFail } from '../../src/node/notImplementedFail.ts'
|
|
|
import * as childProcess from '../../src/node/builtin_modules/implemented/child_process.ts'
|
|
|
+import * as dnsPromises from '../../src/node/builtin_modules/mock/dns/promises.ts'
|
|
|
import * as net from '../../src/node/builtin_modules/mock/net.ts'
|
|
|
import * as sqlite from '../../src/node/builtin_modules/mock/sqlite.ts'
|
|
|
import * as stream from '../../src/node/builtin_modules/implemented/stream.ts'
|
|
|
@@ -33,6 +34,7 @@ const quiet = (): void => { vi.spyOn(console, 'error').mockImplementation(() =>
|
|
|
|
|
|
/** Symbols that refuse when called. */
|
|
|
const CALLED: [string, Record<string, unknown>, readonly string[]][] = [
|
|
|
+ ['node:dns/promises', dnsPromises, ['lookup']],
|
|
|
['node:net', net, ['createServer', 'connect']],
|
|
|
['node:sqlite', sqlite, ['backup']],
|
|
|
['node:vm', vm, ['createContext', 'runInContext', 'runInNewContext', 'runInThisContext', 'isContext']],
|
|
|
@@ -90,7 +92,7 @@ describe('not-implemented stubs', () => {
|
|
|
}
|
|
|
|
|
|
it('keeps the CommonJS interop marker and a default export on every replaced module', () => {
|
|
|
- for (const namespace of [net, sqlite, vm, workerThreads, childProcess, stream, ws, nodePty, piAi, os, perfHooks]) {
|
|
|
+ for (const namespace of [dnsPromises, net, sqlite, vm, workerThreads, childProcess, stream, ws, nodePty, piAi, os, perfHooks]) {
|
|
|
const holder = namespace as { __esModule?: unknown; default?: unknown }
|
|
|
expect(holder.__esModule).toBe(true)
|
|
|
expect(holder.default).toBeDefined()
|