Commit 756b742

Anton Golub <antongolub@antongolub.com>
2024-12-18 18:31:48
test: merge autogenerated vendor tests (#1007)
* test: merge autogenerated vendor tests continues #987 * test: optimize test flow
1 parent 9c84ab3
.github/workflows/test.yml
@@ -67,33 +67,27 @@ jobs:
     runs-on: ubuntu-latest
     env:
       FORCE_COLOR: 3
-    strategy:
-      matrix:
-        node-version: [16.x, 20.x, 22.x]
+
     steps:
       - uses: actions/checkout@v4
 
-      - name: Use Node.js ${{ matrix.node-version }}
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: ${{ matrix.node-version }}
+          node-version: 22.x
 
       - uses: actions/download-artifact@v4
         with:
           name: build
       - run: npm ci
 
-      - name: Unit & types tests
-        if: matrix.node-version == '20.x'
-        run: |
-          npm run test:coverage
-          npm run test:types
-
       - name: Unit tests
-        if: matrix.node-version != '20.x'
-        run: npm run test:unit
+        run: npm run test:coverage
         timeout-minutes: 1
 
+      - name: Type tests
+        run: npm run test:types
+
   smoke-win32-node16:
     runs-on: windows-latest
     needs: build
scripts/build-tests.mjs
@@ -18,34 +18,37 @@ import fs from 'node:fs'
 import path from 'node:path'
 import * as vendor from '../build/vendor.js'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
-const root = path.resolve(__dirname, '..')
+const root = path.resolve(new URL(import.meta.url).pathname, '../..')
 const apis = ['chalk', 'depseek', 'fs', 'minimist', 'ps', 'which', 'YAML']
-
 const copyright = await fs.readFileSync(
   path.resolve(root, 'test/fixtures/copyright.txt'),
   'utf8'
 )
 
-// prettier-ignore
+const filePath = path.resolve(root, `test/vendor-export.test.js`)
+let fileContents = `${copyright.replace('YEAR', new Date().getFullYear())}
+import assert from 'node:assert'
+import { test, describe } from 'node:test'
+import {
+${apis.map((v) => '  ' + v).join(',\n')},
+} from '../build/vendor.js'
+`
+
 apis.forEach((name) => {
   const api = vendor[name]
   const methods = Object.entries(api)
-  const formatAssert = (k, v, prefix = '    ') => `${prefix}assert.equal(typeof ${name}.${k}, '${typeof v}')`
+  const formatAssert = (k, v, prefix = '    ') =>
+    `${prefix}assert.equal(typeof ${name}.${k}, '${typeof v}', '${name}.${k}')`
   const methodChecks = methods.length
     ? '\n' + methods.map(([k, v]) => formatAssert(k, v)).join('\n')
     : ''
-  const filePath = path.resolve(root, `test/vendor-${name.toLowerCase()}.test.js`)
-  const fileContents = `${copyright.replace('YEAR', new Date().getFullYear())}
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { ${name} } from '../build/vendor.js'
-
+  fileContents += `
 describe('vendor ${name} API ', () => {
   test('exports', () => {
     assert.equal(typeof ${name}, '${typeof api}')${methodChecks}
   })
 })
 `
-  fs.writeFileSync(filePath, fileContents)
 })
+
+fs.writeFileSync(filePath, fileContents)
test/all.test.js
@@ -20,4 +20,5 @@ import './goods.test.js'
 import './index.test.js'
 import './package.test.js'
 import './util.test.js'
-import './vendor.test.js'
+import './vendor-yaml.test.js'
+import './vendor-export.test.js'
test/vendor-chalk.test.js
@@ -1,24 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { chalk } from '../build/vendor.js'
-
-describe('vendor chalk API ', () => {
-  test('exports', () => {
-    assert.equal(typeof chalk, 'function')
-    assert.equal(typeof chalk.level, 'number')
-  })
-})
test/vendor-depseek.test.js
@@ -1,23 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { depseek } from '../build/vendor.js'
-
-describe('vendor depseek API ', () => {
-  test('exports', () => {
-    assert.equal(typeof depseek, 'function')
-  })
-})
test/vendor-export.test.js
@@ -0,0 +1,272 @@
+// Copyright 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import assert from 'node:assert'
+import { test, describe } from 'node:test'
+import {
+  chalk,
+  depseek,
+  fs,
+  minimist,
+  ps,
+  which,
+  YAML,
+} from '../build/vendor.js'
+
+describe('vendor chalk API ', () => {
+  test('exports', () => {
+    assert.equal(typeof chalk, 'function')
+    assert.equal(typeof chalk.level, 'number', 'chalk.level')
+  })
+})
+
+describe('vendor depseek API ', () => {
+  test('exports', () => {
+    assert.equal(typeof depseek, 'function')
+  })
+})
+
+describe('vendor fs API ', () => {
+  test('exports', () => {
+    assert.equal(typeof fs, 'object')
+    assert.equal(typeof fs.default, 'object', 'fs.default')
+    assert.equal(typeof fs.appendFile, 'function', 'fs.appendFile')
+    assert.equal(typeof fs.appendFileSync, 'function', 'fs.appendFileSync')
+    assert.equal(typeof fs.access, 'function', 'fs.access')
+    assert.equal(typeof fs.accessSync, 'function', 'fs.accessSync')
+    assert.equal(typeof fs.chown, 'function', 'fs.chown')
+    assert.equal(typeof fs.chownSync, 'function', 'fs.chownSync')
+    assert.equal(typeof fs.chmod, 'function', 'fs.chmod')
+    assert.equal(typeof fs.chmodSync, 'function', 'fs.chmodSync')
+    assert.equal(typeof fs.close, 'function', 'fs.close')
+    assert.equal(typeof fs.closeSync, 'function', 'fs.closeSync')
+    assert.equal(typeof fs.copyFile, 'function', 'fs.copyFile')
+    assert.equal(typeof fs.copyFileSync, 'function', 'fs.copyFileSync')
+    assert.equal(typeof fs.cp, 'function', 'fs.cp')
+    assert.equal(typeof fs.cpSync, 'function', 'fs.cpSync')
+    assert.equal(typeof fs.createReadStream, 'function', 'fs.createReadStream')
+    assert.equal(
+      typeof fs.createWriteStream,
+      'function',
+      'fs.createWriteStream'
+    )
+    assert.equal(typeof fs.exists, 'function', 'fs.exists')
+    assert.equal(typeof fs.existsSync, 'function', 'fs.existsSync')
+    assert.equal(typeof fs.fchown, 'function', 'fs.fchown')
+    assert.equal(typeof fs.fchownSync, 'function', 'fs.fchownSync')
+    assert.equal(typeof fs.fchmod, 'function', 'fs.fchmod')
+    assert.equal(typeof fs.fchmodSync, 'function', 'fs.fchmodSync')
+    assert.equal(typeof fs.fdatasync, 'function', 'fs.fdatasync')
+    assert.equal(typeof fs.fdatasyncSync, 'function', 'fs.fdatasyncSync')
+    assert.equal(typeof fs.fstat, 'function', 'fs.fstat')
+    assert.equal(typeof fs.fstatSync, 'function', 'fs.fstatSync')
+    assert.equal(typeof fs.fsync, 'function', 'fs.fsync')
+    assert.equal(typeof fs.fsyncSync, 'function', 'fs.fsyncSync')
+    assert.equal(typeof fs.ftruncate, 'function', 'fs.ftruncate')
+    assert.equal(typeof fs.ftruncateSync, 'function', 'fs.ftruncateSync')
+    assert.equal(typeof fs.futimes, 'function', 'fs.futimes')
+    assert.equal(typeof fs.futimesSync, 'function', 'fs.futimesSync')
+    assert.equal(typeof fs.glob, 'function', 'fs.glob')
+    assert.equal(typeof fs.globSync, 'function', 'fs.globSync')
+    assert.equal(typeof fs.lchown, 'function', 'fs.lchown')
+    assert.equal(typeof fs.lchownSync, 'function', 'fs.lchownSync')
+    assert.equal(typeof fs.lchmod, 'function', 'fs.lchmod')
+    assert.equal(typeof fs.lchmodSync, 'function', 'fs.lchmodSync')
+    assert.equal(typeof fs.link, 'function', 'fs.link')
+    assert.equal(typeof fs.linkSync, 'function', 'fs.linkSync')
+    assert.equal(typeof fs.lstat, 'function', 'fs.lstat')
+    assert.equal(typeof fs.lstatSync, 'function', 'fs.lstatSync')
+    assert.equal(typeof fs.lutimes, 'function', 'fs.lutimes')
+    assert.equal(typeof fs.lutimesSync, 'function', 'fs.lutimesSync')
+    assert.equal(typeof fs.mkdir, 'function', 'fs.mkdir')
+    assert.equal(typeof fs.mkdirSync, 'function', 'fs.mkdirSync')
+    assert.equal(typeof fs.mkdtemp, 'function', 'fs.mkdtemp')
+    assert.equal(typeof fs.mkdtempSync, 'function', 'fs.mkdtempSync')
+    assert.equal(typeof fs.open, 'function', 'fs.open')
+    assert.equal(typeof fs.openSync, 'function', 'fs.openSync')
+    assert.equal(typeof fs.openAsBlob, 'function', 'fs.openAsBlob')
+    assert.equal(typeof fs.readdir, 'function', 'fs.readdir')
+    assert.equal(typeof fs.readdirSync, 'function', 'fs.readdirSync')
+    assert.equal(typeof fs.read, 'function', 'fs.read')
+    assert.equal(typeof fs.readSync, 'function', 'fs.readSync')
+    assert.equal(typeof fs.readv, 'function', 'fs.readv')
+    assert.equal(typeof fs.readvSync, 'function', 'fs.readvSync')
+    assert.equal(typeof fs.readFile, 'function', 'fs.readFile')
+    assert.equal(typeof fs.readFileSync, 'function', 'fs.readFileSync')
+    assert.equal(typeof fs.readlink, 'function', 'fs.readlink')
+    assert.equal(typeof fs.readlinkSync, 'function', 'fs.readlinkSync')
+    assert.equal(typeof fs.realpath, 'function', 'fs.realpath')
+    assert.equal(typeof fs.realpathSync, 'function', 'fs.realpathSync')
+    assert.equal(typeof fs.rename, 'function', 'fs.rename')
+    assert.equal(typeof fs.renameSync, 'function', 'fs.renameSync')
+    assert.equal(typeof fs.rm, 'function', 'fs.rm')
+    assert.equal(typeof fs.rmSync, 'function', 'fs.rmSync')
+    assert.equal(typeof fs.rmdir, 'function', 'fs.rmdir')
+    assert.equal(typeof fs.rmdirSync, 'function', 'fs.rmdirSync')
+    assert.equal(typeof fs.stat, 'function', 'fs.stat')
+    assert.equal(typeof fs.statfs, 'function', 'fs.statfs')
+    assert.equal(typeof fs.statSync, 'function', 'fs.statSync')
+    assert.equal(typeof fs.statfsSync, 'function', 'fs.statfsSync')
+    assert.equal(typeof fs.symlink, 'function', 'fs.symlink')
+    assert.equal(typeof fs.symlinkSync, 'function', 'fs.symlinkSync')
+    assert.equal(typeof fs.truncate, 'function', 'fs.truncate')
+    assert.equal(typeof fs.truncateSync, 'function', 'fs.truncateSync')
+    assert.equal(typeof fs.unwatchFile, 'function', 'fs.unwatchFile')
+    assert.equal(typeof fs.unlink, 'function', 'fs.unlink')
+    assert.equal(typeof fs.unlinkSync, 'function', 'fs.unlinkSync')
+    assert.equal(typeof fs.utimes, 'function', 'fs.utimes')
+    assert.equal(typeof fs.utimesSync, 'function', 'fs.utimesSync')
+    assert.equal(typeof fs.watch, 'function', 'fs.watch')
+    assert.equal(typeof fs.watchFile, 'function', 'fs.watchFile')
+    assert.equal(typeof fs.writeFile, 'function', 'fs.writeFile')
+    assert.equal(typeof fs.writeFileSync, 'function', 'fs.writeFileSync')
+    assert.equal(typeof fs.write, 'function', 'fs.write')
+    assert.equal(typeof fs.writeSync, 'function', 'fs.writeSync')
+    assert.equal(typeof fs.writev, 'function', 'fs.writev')
+    assert.equal(typeof fs.writevSync, 'function', 'fs.writevSync')
+    assert.equal(typeof fs.Dirent, 'function', 'fs.Dirent')
+    assert.equal(typeof fs.Stats, 'function', 'fs.Stats')
+    assert.equal(typeof fs.ReadStream, 'function', 'fs.ReadStream')
+    assert.equal(typeof fs.WriteStream, 'function', 'fs.WriteStream')
+    assert.equal(typeof fs.FileReadStream, 'function', 'fs.FileReadStream')
+    assert.equal(typeof fs.FileWriteStream, 'function', 'fs.FileWriteStream')
+    assert.equal(typeof fs._toUnixTimestamp, 'function', 'fs._toUnixTimestamp')
+    assert.equal(typeof fs.Dir, 'function', 'fs.Dir')
+    assert.equal(typeof fs.opendir, 'function', 'fs.opendir')
+    assert.equal(typeof fs.opendirSync, 'function', 'fs.opendirSync')
+    assert.equal(typeof fs.F_OK, 'number', 'fs.F_OK')
+    assert.equal(typeof fs.R_OK, 'number', 'fs.R_OK')
+    assert.equal(typeof fs.W_OK, 'number', 'fs.W_OK')
+    assert.equal(typeof fs.X_OK, 'number', 'fs.X_OK')
+    assert.equal(typeof fs.constants, 'object', 'fs.constants')
+    assert.equal(typeof fs.promises, 'object', 'fs.promises')
+    assert.equal(typeof fs.gracefulify, 'function', 'fs.gracefulify')
+    assert.equal(typeof fs.copy, 'function', 'fs.copy')
+    assert.equal(typeof fs.copySync, 'function', 'fs.copySync')
+    assert.equal(typeof fs.emptyDirSync, 'function', 'fs.emptyDirSync')
+    assert.equal(typeof fs.emptydirSync, 'function', 'fs.emptydirSync')
+    assert.equal(typeof fs.emptyDir, 'function', 'fs.emptyDir')
+    assert.equal(typeof fs.emptydir, 'function', 'fs.emptydir')
+    assert.equal(typeof fs.createFile, 'function', 'fs.createFile')
+    assert.equal(typeof fs.createFileSync, 'function', 'fs.createFileSync')
+    assert.equal(typeof fs.ensureFile, 'function', 'fs.ensureFile')
+    assert.equal(typeof fs.ensureFileSync, 'function', 'fs.ensureFileSync')
+    assert.equal(typeof fs.createLink, 'function', 'fs.createLink')
+    assert.equal(typeof fs.createLinkSync, 'function', 'fs.createLinkSync')
+    assert.equal(typeof fs.ensureLink, 'function', 'fs.ensureLink')
+    assert.equal(typeof fs.ensureLinkSync, 'function', 'fs.ensureLinkSync')
+    assert.equal(typeof fs.createSymlink, 'function', 'fs.createSymlink')
+    assert.equal(
+      typeof fs.createSymlinkSync,
+      'function',
+      'fs.createSymlinkSync'
+    )
+    assert.equal(typeof fs.ensureSymlink, 'function', 'fs.ensureSymlink')
+    assert.equal(
+      typeof fs.ensureSymlinkSync,
+      'function',
+      'fs.ensureSymlinkSync'
+    )
+    assert.equal(typeof fs.readJson, 'function', 'fs.readJson')
+    assert.equal(typeof fs.readJsonSync, 'function', 'fs.readJsonSync')
+    assert.equal(typeof fs.writeJson, 'function', 'fs.writeJson')
+    assert.equal(typeof fs.writeJsonSync, 'function', 'fs.writeJsonSync')
+    assert.equal(typeof fs.outputJson, 'function', 'fs.outputJson')
+    assert.equal(typeof fs.outputJsonSync, 'function', 'fs.outputJsonSync')
+    assert.equal(typeof fs.outputJSON, 'function', 'fs.outputJSON')
+    assert.equal(typeof fs.outputJSONSync, 'function', 'fs.outputJSONSync')
+    assert.equal(typeof fs.writeJSON, 'function', 'fs.writeJSON')
+    assert.equal(typeof fs.writeJSONSync, 'function', 'fs.writeJSONSync')
+    assert.equal(typeof fs.readJSON, 'function', 'fs.readJSON')
+    assert.equal(typeof fs.readJSONSync, 'function', 'fs.readJSONSync')
+    assert.equal(typeof fs.mkdirs, 'function', 'fs.mkdirs')
+    assert.equal(typeof fs.mkdirsSync, 'function', 'fs.mkdirsSync')
+    assert.equal(typeof fs.mkdirp, 'function', 'fs.mkdirp')
+    assert.equal(typeof fs.mkdirpSync, 'function', 'fs.mkdirpSync')
+    assert.equal(typeof fs.ensureDir, 'function', 'fs.ensureDir')
+    assert.equal(typeof fs.ensureDirSync, 'function', 'fs.ensureDirSync')
+    assert.equal(typeof fs.move, 'function', 'fs.move')
+    assert.equal(typeof fs.moveSync, 'function', 'fs.moveSync')
+    assert.equal(typeof fs.outputFile, 'function', 'fs.outputFile')
+    assert.equal(typeof fs.outputFileSync, 'function', 'fs.outputFileSync')
+    assert.equal(typeof fs.pathExists, 'function', 'fs.pathExists')
+    assert.equal(typeof fs.pathExistsSync, 'function', 'fs.pathExistsSync')
+    assert.equal(typeof fs.remove, 'function', 'fs.remove')
+    assert.equal(typeof fs.removeSync, 'function', 'fs.removeSync')
+  })
+})
+
+describe('vendor minimist API ', () => {
+  test('exports', () => {
+    assert.equal(typeof minimist, 'function')
+  })
+})
+
+describe('vendor ps API ', () => {
+  test('exports', () => {
+    assert.equal(typeof ps, 'object')
+    assert.equal(typeof ps.kill, 'function', 'ps.kill')
+    assert.equal(typeof ps.lookup, 'function', 'ps.lookup')
+    assert.equal(typeof ps.lookupSync, 'function', 'ps.lookupSync')
+    assert.equal(typeof ps.tree, 'function', 'ps.tree')
+    assert.equal(typeof ps.treeSync, 'function', 'ps.treeSync')
+  })
+})
+
+describe('vendor which API ', () => {
+  test('exports', () => {
+    assert.equal(typeof which, 'function')
+    assert.equal(typeof which.sync, 'function', 'which.sync')
+  })
+})
+
+describe('vendor YAML API ', () => {
+  test('exports', () => {
+    assert.equal(typeof YAML, 'object')
+    assert.equal(typeof YAML.Alias, 'function', 'YAML.Alias')
+    assert.equal(typeof YAML.CST, 'object', 'YAML.CST')
+    assert.equal(typeof YAML.Composer, 'function', 'YAML.Composer')
+    assert.equal(typeof YAML.Document, 'function', 'YAML.Document')
+    assert.equal(typeof YAML.Lexer, 'function', 'YAML.Lexer')
+    assert.equal(typeof YAML.LineCounter, 'function', 'YAML.LineCounter')
+    assert.equal(typeof YAML.Pair, 'function', 'YAML.Pair')
+    assert.equal(typeof YAML.Parser, 'function', 'YAML.Parser')
+    assert.equal(typeof YAML.Scalar, 'function', 'YAML.Scalar')
+    assert.equal(typeof YAML.Schema, 'function', 'YAML.Schema')
+    assert.equal(typeof YAML.YAMLError, 'function', 'YAML.YAMLError')
+    assert.equal(typeof YAML.YAMLMap, 'function', 'YAML.YAMLMap')
+    assert.equal(typeof YAML.YAMLParseError, 'function', 'YAML.YAMLParseError')
+    assert.equal(typeof YAML.YAMLSeq, 'function', 'YAML.YAMLSeq')
+    assert.equal(typeof YAML.YAMLWarning, 'function', 'YAML.YAMLWarning')
+    assert.equal(typeof YAML.default, 'object', 'YAML.default')
+    assert.equal(typeof YAML.isAlias, 'function', 'YAML.isAlias')
+    assert.equal(typeof YAML.isCollection, 'function', 'YAML.isCollection')
+    assert.equal(typeof YAML.isDocument, 'function', 'YAML.isDocument')
+    assert.equal(typeof YAML.isMap, 'function', 'YAML.isMap')
+    assert.equal(typeof YAML.isNode, 'function', 'YAML.isNode')
+    assert.equal(typeof YAML.isPair, 'function', 'YAML.isPair')
+    assert.equal(typeof YAML.isScalar, 'function', 'YAML.isScalar')
+    assert.equal(typeof YAML.isSeq, 'function', 'YAML.isSeq')
+    assert.equal(typeof YAML.parse, 'function', 'YAML.parse')
+    assert.equal(
+      typeof YAML.parseAllDocuments,
+      'function',
+      'YAML.parseAllDocuments'
+    )
+    assert.equal(typeof YAML.parseDocument, 'function', 'YAML.parseDocument')
+    assert.equal(typeof YAML.stringify, 'function', 'YAML.stringify')
+    assert.equal(typeof YAML.visit, 'function', 'YAML.visit')
+    assert.equal(typeof YAML.visitAsync, 'function', 'YAML.visitAsync')
+  })
+})
test/vendor-fs.test.js
@@ -1,175 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { fs } from '../build/vendor.js'
-
-describe('vendor fs API ', () => {
-  test('exports', () => {
-    assert.equal(typeof fs, 'object')
-    assert.equal(typeof fs.default, 'object')
-    assert.equal(typeof fs.appendFile, 'function')
-    assert.equal(typeof fs.appendFileSync, 'function')
-    assert.equal(typeof fs.access, 'function')
-    assert.equal(typeof fs.accessSync, 'function')
-    assert.equal(typeof fs.chown, 'function')
-    assert.equal(typeof fs.chownSync, 'function')
-    assert.equal(typeof fs.chmod, 'function')
-    assert.equal(typeof fs.chmodSync, 'function')
-    assert.equal(typeof fs.close, 'function')
-    assert.equal(typeof fs.closeSync, 'function')
-    assert.equal(typeof fs.copyFile, 'function')
-    assert.equal(typeof fs.copyFileSync, 'function')
-    assert.equal(typeof fs.cp, 'function')
-    assert.equal(typeof fs.cpSync, 'function')
-    assert.equal(typeof fs.createReadStream, 'function')
-    assert.equal(typeof fs.createWriteStream, 'function')
-    assert.equal(typeof fs.exists, 'function')
-    assert.equal(typeof fs.existsSync, 'function')
-    assert.equal(typeof fs.fchown, 'function')
-    assert.equal(typeof fs.fchownSync, 'function')
-    assert.equal(typeof fs.fchmod, 'function')
-    assert.equal(typeof fs.fchmodSync, 'function')
-    assert.equal(typeof fs.fdatasync, 'function')
-    assert.equal(typeof fs.fdatasyncSync, 'function')
-    assert.equal(typeof fs.fstat, 'function')
-    assert.equal(typeof fs.fstatSync, 'function')
-    assert.equal(typeof fs.fsync, 'function')
-    assert.equal(typeof fs.fsyncSync, 'function')
-    assert.equal(typeof fs.ftruncate, 'function')
-    assert.equal(typeof fs.ftruncateSync, 'function')
-    assert.equal(typeof fs.futimes, 'function')
-    assert.equal(typeof fs.futimesSync, 'function')
-    assert.equal(typeof fs.glob, 'function')
-    assert.equal(typeof fs.globSync, 'function')
-    assert.equal(typeof fs.lchown, 'function')
-    assert.equal(typeof fs.lchownSync, 'function')
-    assert.equal(typeof fs.lchmod, 'function')
-    assert.equal(typeof fs.lchmodSync, 'function')
-    assert.equal(typeof fs.link, 'function')
-    assert.equal(typeof fs.linkSync, 'function')
-    assert.equal(typeof fs.lstat, 'function')
-    assert.equal(typeof fs.lstatSync, 'function')
-    assert.equal(typeof fs.lutimes, 'function')
-    assert.equal(typeof fs.lutimesSync, 'function')
-    assert.equal(typeof fs.mkdir, 'function')
-    assert.equal(typeof fs.mkdirSync, 'function')
-    assert.equal(typeof fs.mkdtemp, 'function')
-    assert.equal(typeof fs.mkdtempSync, 'function')
-    assert.equal(typeof fs.open, 'function')
-    assert.equal(typeof fs.openSync, 'function')
-    assert.equal(typeof fs.openAsBlob, 'function')
-    assert.equal(typeof fs.readdir, 'function')
-    assert.equal(typeof fs.readdirSync, 'function')
-    assert.equal(typeof fs.read, 'function')
-    assert.equal(typeof fs.readSync, 'function')
-    assert.equal(typeof fs.readv, 'function')
-    assert.equal(typeof fs.readvSync, 'function')
-    assert.equal(typeof fs.readFile, 'function')
-    assert.equal(typeof fs.readFileSync, 'function')
-    assert.equal(typeof fs.readlink, 'function')
-    assert.equal(typeof fs.readlinkSync, 'function')
-    assert.equal(typeof fs.realpath, 'function')
-    assert.equal(typeof fs.realpathSync, 'function')
-    assert.equal(typeof fs.rename, 'function')
-    assert.equal(typeof fs.renameSync, 'function')
-    assert.equal(typeof fs.rm, 'function')
-    assert.equal(typeof fs.rmSync, 'function')
-    assert.equal(typeof fs.rmdir, 'function')
-    assert.equal(typeof fs.rmdirSync, 'function')
-    assert.equal(typeof fs.stat, 'function')
-    assert.equal(typeof fs.statfs, 'function')
-    assert.equal(typeof fs.statSync, 'function')
-    assert.equal(typeof fs.statfsSync, 'function')
-    assert.equal(typeof fs.symlink, 'function')
-    assert.equal(typeof fs.symlinkSync, 'function')
-    assert.equal(typeof fs.truncate, 'function')
-    assert.equal(typeof fs.truncateSync, 'function')
-    assert.equal(typeof fs.unwatchFile, 'function')
-    assert.equal(typeof fs.unlink, 'function')
-    assert.equal(typeof fs.unlinkSync, 'function')
-    assert.equal(typeof fs.utimes, 'function')
-    assert.equal(typeof fs.utimesSync, 'function')
-    assert.equal(typeof fs.watch, 'function')
-    assert.equal(typeof fs.watchFile, 'function')
-    assert.equal(typeof fs.writeFile, 'function')
-    assert.equal(typeof fs.writeFileSync, 'function')
-    assert.equal(typeof fs.write, 'function')
-    assert.equal(typeof fs.writeSync, 'function')
-    assert.equal(typeof fs.writev, 'function')
-    assert.equal(typeof fs.writevSync, 'function')
-    assert.equal(typeof fs.Dirent, 'function')
-    assert.equal(typeof fs.Stats, 'function')
-    assert.equal(typeof fs.ReadStream, 'function')
-    assert.equal(typeof fs.WriteStream, 'function')
-    assert.equal(typeof fs.FileReadStream, 'function')
-    assert.equal(typeof fs.FileWriteStream, 'function')
-    assert.equal(typeof fs._toUnixTimestamp, 'function')
-    assert.equal(typeof fs.Dir, 'function')
-    assert.equal(typeof fs.opendir, 'function')
-    assert.equal(typeof fs.opendirSync, 'function')
-    assert.equal(typeof fs.F_OK, 'number')
-    assert.equal(typeof fs.R_OK, 'number')
-    assert.equal(typeof fs.W_OK, 'number')
-    assert.equal(typeof fs.X_OK, 'number')
-    assert.equal(typeof fs.constants, 'object')
-    assert.equal(typeof fs.promises, 'object')
-    assert.equal(typeof fs.gracefulify, 'function')
-    assert.equal(typeof fs.copy, 'function')
-    assert.equal(typeof fs.copySync, 'function')
-    assert.equal(typeof fs.emptyDirSync, 'function')
-    assert.equal(typeof fs.emptydirSync, 'function')
-    assert.equal(typeof fs.emptyDir, 'function')
-    assert.equal(typeof fs.emptydir, 'function')
-    assert.equal(typeof fs.createFile, 'function')
-    assert.equal(typeof fs.createFileSync, 'function')
-    assert.equal(typeof fs.ensureFile, 'function')
-    assert.equal(typeof fs.ensureFileSync, 'function')
-    assert.equal(typeof fs.createLink, 'function')
-    assert.equal(typeof fs.createLinkSync, 'function')
-    assert.equal(typeof fs.ensureLink, 'function')
-    assert.equal(typeof fs.ensureLinkSync, 'function')
-    assert.equal(typeof fs.createSymlink, 'function')
-    assert.equal(typeof fs.createSymlinkSync, 'function')
-    assert.equal(typeof fs.ensureSymlink, 'function')
-    assert.equal(typeof fs.ensureSymlinkSync, 'function')
-    assert.equal(typeof fs.readJson, 'function')
-    assert.equal(typeof fs.readJsonSync, 'function')
-    assert.equal(typeof fs.writeJson, 'function')
-    assert.equal(typeof fs.writeJsonSync, 'function')
-    assert.equal(typeof fs.outputJson, 'function')
-    assert.equal(typeof fs.outputJsonSync, 'function')
-    assert.equal(typeof fs.outputJSON, 'function')
-    assert.equal(typeof fs.outputJSONSync, 'function')
-    assert.equal(typeof fs.writeJSON, 'function')
-    assert.equal(typeof fs.writeJSONSync, 'function')
-    assert.equal(typeof fs.readJSON, 'function')
-    assert.equal(typeof fs.readJSONSync, 'function')
-    assert.equal(typeof fs.mkdirs, 'function')
-    assert.equal(typeof fs.mkdirsSync, 'function')
-    assert.equal(typeof fs.mkdirp, 'function')
-    assert.equal(typeof fs.mkdirpSync, 'function')
-    assert.equal(typeof fs.ensureDir, 'function')
-    assert.equal(typeof fs.ensureDirSync, 'function')
-    assert.equal(typeof fs.move, 'function')
-    assert.equal(typeof fs.moveSync, 'function')
-    assert.equal(typeof fs.outputFile, 'function')
-    assert.equal(typeof fs.outputFileSync, 'function')
-    assert.equal(typeof fs.pathExists, 'function')
-    assert.equal(typeof fs.pathExistsSync, 'function')
-    assert.equal(typeof fs.remove, 'function')
-    assert.equal(typeof fs.removeSync, 'function')
-  })
-})
test/vendor-minimist.test.js
@@ -1,23 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { minimist } from '../build/vendor.js'
-
-describe('vendor minimist API ', () => {
-  test('exports', () => {
-    assert.equal(typeof minimist, 'function')
-  })
-})
test/vendor-ps.test.js
@@ -1,28 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { ps } from '../build/vendor.js'
-
-describe('vendor ps API ', () => {
-  test('exports', () => {
-    assert.equal(typeof ps, 'object')
-    assert.equal(typeof ps.kill, 'function')
-    assert.equal(typeof ps.lookup, 'function')
-    assert.equal(typeof ps.lookupSync, 'function')
-    assert.equal(typeof ps.tree, 'function')
-    assert.equal(typeof ps.treeSync, 'function')
-  })
-})
test/vendor-which.test.js
@@ -1,24 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { which } from '../build/vendor.js'
-
-describe('vendor which API ', () => {
-  test('exports', () => {
-    assert.equal(typeof which, 'function')
-    assert.equal(typeof which.sync, 'function')
-  })
-})
test/vendor-yaml.test.js
@@ -16,38 +16,12 @@ import assert from 'node:assert'
 import { test, describe } from 'node:test'
 import { YAML } from '../build/vendor.js'
 
-describe('vendor YAML API ', () => {
-  test('exports', () => {
-    assert.equal(typeof YAML, 'object')
-    assert.equal(typeof YAML.Alias, 'function')
-    assert.equal(typeof YAML.CST, 'object')
-    assert.equal(typeof YAML.Composer, 'function')
-    assert.equal(typeof YAML.Document, 'function')
-    assert.equal(typeof YAML.Lexer, 'function')
-    assert.equal(typeof YAML.LineCounter, 'function')
-    assert.equal(typeof YAML.Pair, 'function')
-    assert.equal(typeof YAML.Parser, 'function')
-    assert.equal(typeof YAML.Scalar, 'function')
-    assert.equal(typeof YAML.Schema, 'function')
-    assert.equal(typeof YAML.YAMLError, 'function')
-    assert.equal(typeof YAML.YAMLMap, 'function')
-    assert.equal(typeof YAML.YAMLParseError, 'function')
-    assert.equal(typeof YAML.YAMLSeq, 'function')
-    assert.equal(typeof YAML.YAMLWarning, 'function')
-    assert.equal(typeof YAML.default, 'object')
-    assert.equal(typeof YAML.isAlias, 'function')
-    assert.equal(typeof YAML.isCollection, 'function')
-    assert.equal(typeof YAML.isDocument, 'function')
-    assert.equal(typeof YAML.isMap, 'function')
-    assert.equal(typeof YAML.isNode, 'function')
-    assert.equal(typeof YAML.isPair, 'function')
-    assert.equal(typeof YAML.isScalar, 'function')
-    assert.equal(typeof YAML.isSeq, 'function')
-    assert.equal(typeof YAML.parse, 'function')
-    assert.equal(typeof YAML.parseAllDocuments, 'function')
-    assert.equal(typeof YAML.parseDocument, 'function')
-    assert.equal(typeof YAML.stringify, 'function')
-    assert.equal(typeof YAML.visit, 'function')
-    assert.equal(typeof YAML.visitAsync, 'function')
+describe('YAML', () => {
+  test('YAML.parse', () => {
+    assert.deepEqual(YAML.parse('a: b\n'), { a: 'b' })
+  })
+
+  test('YAML.stringify', () => {
+    assert.equal(YAML.stringify({ a: 'b' }), 'a: b\n')
   })
 })
test/vendor.test.js
@@ -1,56 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import assert from 'node:assert'
-import { test, describe } from 'node:test'
-import { YAML } from '../build/vendor.js'
-
-describe('YAML', () => {
-  test('YAML.parse', () => {
-    assert.deepEqual(YAML.parse('a: b\n'), { a: 'b' })
-  })
-
-  test('YAML.stringify', () => {
-    assert.equal(YAML.stringify({ a: 'b' }), 'a: b\n')
-  })
-
-  test('exposes YAML extras', () => {
-    ;[
-      'parseAllDocuments',
-      'parseDocument',
-      'isAlias',
-      'isCollection',
-      'isDocument',
-      'isMap',
-      'isNode',
-      'isPair',
-      'isScalar',
-      'isSeq',
-      'Alias',
-      'Composer',
-      'Document',
-      'Schema',
-      'YAMLSeq',
-      'YAMLMap',
-      'YAMLError',
-      'YAMLParseError',
-      'YAMLWarning',
-      'Pair',
-      'Scalar',
-      'Lexer',
-      'LineCounter',
-      'Parser',
-    ].forEach((k) => assert.ok(k in YAML))
-  })
-})