loqatevars
Version:
Locate JavaScript files with 'const' or 'process.env' usage in LLM-generated codebases
618 lines (422 loc) • 23 kB
Plain Text
~/workspace$ npm test
> loqatevars@1.0.4 test
> node --experimental-vm-modules node_modules/jest/bin/jest.js tests
PASS tests/integration.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🛠️ run anywhere with `dotenvx run -- yourcommand`)
at _log (node_modules/dotenv/lib/main.js:136:11)
(node:686) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS tests/cli.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/utils.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ override existing env vars with { override: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
(node:693) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS tests/glob-patterns.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🛠️ run anywhere with `dotenvx run -- yourcommand`)
at _log (node_modules/dotenv/lib/main.js:136:11)
(node:687) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS tests/indirect-env.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/findMatchingFilesDetailed.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/cli.default.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/cli.multipleOptions.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.defaultStreamFallback.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/localVars.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/cli.invalidCommand.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ load multiple .env files with { path: ['.env.local', '.env'] })
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/asyncPool.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/cli.run.test.js
PASS tests/cli.helpCommand.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.invalid-extension.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/findMatchingFiles.single.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.invalidExtensionType.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.success.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ override existing env vars with { override: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/errors.test.js
PASS tests/asyncPool.cleanup.test.js
PASS tests/function-scope.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/index.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/findMatchingFiles.invalid.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ load multiple .env files with { path: ['.env.local', '.env'] })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.invalid.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
Test Suites: 26 passed, 26 total
Tests: 64 passed, 64 total
Snapshots: 0 total
Time: 3.486 s
Ran all test suites matching /tests/i.
~/workspace$ npm i
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
added 55 packages, removed 16 packages, changed 64 packages, and audited 329 packages in 3s
55 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
~/workspace$ npm test
> loqatevars@1.0.4 test
> node --experimental-vm-modules node_modules/jest/bin/jest.js tests
FAIL tests/integration.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/integration.test.js:11:18)
FAIL tests/cli.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.test.js:1:18)
(node:865) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS tests/utils.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🛠️ run anywhere with `dotenvx run -- yourcommand`)
at _log (node_modules/dotenv/lib/main.js:136:11)
(node:866) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
PASS tests/glob-patterns.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/cli.run.test.js
FAIL tests/cli.invalidCommand.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.invalidCommand.test.js:1:18)
PASS tests/findMatchingFilesDetailed.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.defaultStreamFallback.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
FAIL tests/cli.multipleOptions.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.multipleOptions.test.js:1:18)
FAIL tests/cli.default.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.default.test.js:7:18)
PASS tests/searchFiles.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/asyncPool.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/indirect-env.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 encrypt with dotenvx: https://dotenvx.com)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/findMatchingFiles.single.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ enable debug logging with { debug: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
FAIL tests/cli.helpCommand.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.helpCommand.test.js:1:18)
PASS tests/localVars.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent committing .env to code: https://dotenvx.com/precommit)
at _log (node_modules/dotenv/lib/main.js:136:11)
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ suppress all logs with { quiet: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.invalidExtensionType.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild)
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/index.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/findMatchingFiles.invalid.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ write to custom object with { processEnv: myObject })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/searchFiles.invalid-extension.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ load multiple .env files with { path: ['.env.local', '.env'] })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.success.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/errors.test.js
PASS tests/function-scope.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ override existing env vars with { override: true })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/validateDirectory.invalid.test.js
● Console
console.log
[dotenv@17.2.0] injecting env (0) from .env (tip: ⚙️ specify custom .env file path with { path: '/custom/path/.env' })
at _log (node_modules/dotenv/lib/main.js:136:11)
PASS tests/asyncPool.cleanup.test.js
Summary of all failing tests
FAIL tests/integration.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/integration.test.js:11:18)
FAIL tests/cli.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.test.js:1:18)
FAIL tests/cli.invalidCommand.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.invalidCommand.test.js:1:18)
FAIL tests/cli.multipleOptions.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.multipleOptions.test.js:1:18)
FAIL tests/cli.default.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.default.test.js:7:18)
FAIL tests/cli.helpCommand.test.js
● Test suite failed to run
Must use import to load ES Module: /home/runner/workspace/node_modules/yargs/index.mjs
8 | // Import scanning functions directly from lib to avoid circular dependency when
9 | // index.js also requires this module
> 10 | const yargs = require('yargs/yargs');
| ^
11 | const { hideBin } = require('yargs/helpers');
12 | const { findMatchingFiles, findMatchingFilesDetailed } = require('./lib/utils.js');
13 | const { AppError, OperationalError, ProgrammerError } = require('./lib/errors');
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:799:21)
at Object.require (cli.js:10:15)
at Object.require (tests/cli.helpCommand.test.js:1:18)
Test Suites: 6 failed, 20 passed, 26 total
Tests: 49 passed, 49 total
Snapshots: 0 total
Time: 2.377 s, estimated 4 s
Ran all test suites matching tests.