From e024276f5f7c85acb5bcc5df89d17ff75f303bb5 Mon Sep 17 00:00:00 2001 From: Luke Watts Date: Wed, 23 Oct 2024 14:55:46 +0200 Subject: [PATCH] Revert "fix: respect default detection depth of 4" This reverts commit 45a74eaf68404a2c046fe11d73682a8b5750368f. --- src/lib/constants.ts | 3 - src/lib/find-files.ts | 47 ++-- src/lib/plugins/get-deps-from-plugin.ts | 3 +- src/lib/plugins/get-extra-project-count.ts | 3 - .../workspaces/mono-repo-nested/.gitignore | 2 - .../workspaces/mono-repo-nested/README.md | 5 - .../mono-repo-nested/level-1/level-2/Gemfile | 5 - .../level-1/level-2/Gemfile.lock | 19 -- .../level-1/level-2/level-3/level-4/Gemfile | 5 - .../level-2/level-3/level-4/Gemfile.lock | 19 -- .../level-3/level-4/level-5/level-6/Gemfile | 6 - .../level-4/level-5/level-6/Gemfile.lock | 71 ------ .../level-3/level-4/level-5/package-lock.json | 18 -- .../level-3/level-4/level-5/package.json | 14 -- .../level-1/level-2/level-3/package-lock.json | 18 -- .../level-1/level-2/level-3/package.json | 14 -- .../level-1/node_modules/node-uuid/README.md | 203 ------------------ .../node_modules/node-uuid/package.json | 56 ----- .../level-1/node_modules/qs/Readme.md | 38 ---- .../level-1/node_modules/qs/package.json | 40 ---- .../mono-repo-nested/level-1/package.json | 35 --- .../node_modules/node-uuid/README.md | 203 ------------------ .../node_modules/node-uuid/package.json | 56 ----- .../node_modules/qs/Readme.md | 38 ---- .../node_modules/qs/package.json | 40 ---- .../mono-repo-nested/package-lock.json | 18 -- .../workspaces/mono-repo-nested/package.json | 14 -- .../acceptance/snyk-test/all-projects.spec.ts | 42 ---- test/tap/find-files.test.ts | 24 --- 29 files changed, 22 insertions(+), 1037 deletions(-) delete mode 100644 test/acceptance/workspaces/mono-repo-nested/.gitignore delete mode 100644 test/acceptance/workspaces/mono-repo-nested/README.md delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/level-1/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md delete mode 100644 test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md delete mode 100644 test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/package-lock.json delete mode 100644 test/acceptance/workspaces/mono-repo-nested/package.json diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 61b2bd178e..c88460e4d2 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -10,6 +10,3 @@ export const CALL_PATH_LEADING_ELEMENTS = 2; // Number of function names to show in the end of an abbreviated call path export const CALL_PATH_TRAILING_ELEMENTS = 2; - -// Number of subdirectories to search when running monitor or test -export const MAX_DETECTION_DEPTH = 4; diff --git a/src/lib/find-files.ts b/src/lib/find-files.ts index f841d34547..5da2328277 100644 --- a/src/lib/find-files.ts +++ b/src/lib/find-files.ts @@ -3,14 +3,13 @@ import * as pathLib from 'path'; import * as sortBy from 'lodash.sortby'; import * as groupBy from 'lodash.groupby'; +import * as assign from 'lodash.assign'; import { detectPackageManagerFromFile } from './detect'; import * as debugModule from 'debug'; import { PNPM_FEATURE_FLAG, SUPPORTED_MANIFEST_FILES, } from './package-managers'; -import * as merge from 'lodash.merge'; -import { MAX_DETECTION_DEPTH } from './constants'; const debug = debugModule('snyk:find-files'); @@ -56,12 +55,28 @@ interface FindFilesRes { const ignoreFolders = ['node_modules', '.build']; interface FindFilesConfig { + path: string; + ignore?: string[]; + filter?: string[]; + levelsDeep?: number; + featureFlags?: Set; +} + +type DefaultFindConfig = { path: string; ignore: string[]; filter: string[]; levelsDeep: number; featureFlags: Set; -} +}; + +const defaultFindConfig: DefaultFindConfig = { + path: '', + ignore: [], + filter: [], + levelsDeep: 4, + featureFlags: new Set(), +}; /** * Find all files in given search path. Returns paths to files found. @@ -71,10 +86,8 @@ interface FindFilesConfig { * @param filter (optional) file names to find. If not provided all files are returned. * @param levelsDeep (optional) how many levels deep to search, defaults to two, this path and one sub directory. */ -export async function find( - findConfig: Partial, -): Promise { - const config = getFindConfig(findConfig); +export async function find(findConfig: FindFilesConfig): Promise { + const config: DefaultFindConfig = assign({}, defaultFindConfig, findConfig); const found: string[] = []; const foundAll: string[] = []; @@ -139,28 +152,10 @@ function findFile(path: string, filter: string[] = []): string | null { return null; } -function getFindConfig(option: Partial): FindFilesConfig { - const result = merge( - { - path: '', - ignore: [], - filter: [], - levelsDeep: MAX_DETECTION_DEPTH, - featureFlags: new Set(), - }, - option, - ); - - if (isNaN(result.levelsDeep) || result.levelsDeep === null) { - result.levelsDeep = MAX_DETECTION_DEPTH; - } - return result; -} - async function findInDirectory( findConfig: FindFilesConfig, ): Promise { - const config = getFindConfig(findConfig); + const config: DefaultFindConfig = assign({}, defaultFindConfig, findConfig); const files = await readDirectory(config.path); const toFind = files .filter((file) => !config.ignore.includes(file)) diff --git a/src/lib/plugins/get-deps-from-plugin.ts b/src/lib/plugins/get-deps-from-plugin.ts index 718e7fd430..13c4039a27 100644 --- a/src/lib/plugins/get-deps-from-plugin.ts +++ b/src/lib/plugins/get-deps-from-plugin.ts @@ -21,7 +21,6 @@ import { convertSingleResultToMultiCustom } from './convert-single-splugin-res-t import { convertMultiResultToMultiCustom } from './convert-multi-plugin-res-to-multi-custom'; import { processYarnWorkspaces } from './nodejs-plugin/yarn-workspaces-parser'; import { ScannedProject } from '@snyk/cli-interface/legacy/common'; -import { MAX_DETECTION_DEPTH } from '../constants'; const debug = debugModule('snyk-test'); @@ -44,7 +43,7 @@ export async function getDepsFromPlugin( ): Promise { if (Object.keys(multiProjectProcessors).some((key) => options[key])) { const scanType = options.yarnWorkspaces ? 'yarnWorkspaces' : 'allProjects'; - const levelsDeep = options.detectionDepth || MAX_DETECTION_DEPTH; + const levelsDeep = options.detectionDepth; const ignore = options.exclude ? options.exclude.split(',') : []; const { files: targetFiles, allFilesFound } = await find({ diff --git a/src/lib/plugins/get-extra-project-count.ts b/src/lib/plugins/get-extra-project-count.ts index c6d3ffca28..a923d9f83c 100644 --- a/src/lib/plugins/get-extra-project-count.ts +++ b/src/lib/plugins/get-extra-project-count.ts @@ -2,7 +2,6 @@ import { legacyPlugin as pluginApi } from '@snyk/cli-interface'; import { find } from '../find-files'; import { AUTO_DETECTABLE_FILES } from '../detect'; import { Options } from '../types'; -import { MAX_DETECTION_DEPTH } from '../constants'; export async function getExtraProjectCount( root: string, @@ -24,8 +23,6 @@ export async function getExtraProjectCount( path: root, ignore: [], filter: AUTO_DETECTABLE_FILES, - levelsDeep: MAX_DETECTION_DEPTH, - featureFlags: new Set(), }); const foundProjectsCount = extraTargetFiles.length > 1 ? extraTargetFiles.length - 1 : undefined; diff --git a/test/acceptance/workspaces/mono-repo-nested/.gitignore b/test/acceptance/workspaces/mono-repo-nested/.gitignore deleted file mode 100644 index 9c108a1068..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -project/target diff --git a/test/acceptance/workspaces/mono-repo-nested/README.md b/test/acceptance/workspaces/mono-repo-nested/README.md deleted file mode 100644 index 4290b5add4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Simple Monorepo - -This repository contains a number of different projects, both at the root and in directories. - -It is used as a simple test fixture for monorepo and multi-language support on [Snyk.io](https://snyk.io). As such, each "project" is merely the files needed to describe dependencies. diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile deleted file mode 100644 index 8827060912..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rack-cache", "~> 1.1.0" -gem "rack", "~> 1.6.2" -gem "rack-protection", "~> 1.5.0" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock deleted file mode 100644 index f8cd4503f8..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - rack (1.6.5) - rack-cache (1.1) - rack (>= 0.4) - rack-protection (1.5.3) - rack - -PLATFORMS - ruby - -DEPENDENCIES - rack (~> 1.6.2) - rack-cache (~> 1.1.0) - rack-protection (~> 1.5.0) - -BUNDLED WITH - 1.14.3 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile deleted file mode 100644 index 8827060912..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rack-cache", "~> 1.1.0" -gem "rack", "~> 1.6.2" -gem "rack-protection", "~> 1.5.0" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock deleted file mode 100644 index f8cd4503f8..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - rack (1.6.5) - rack-cache (1.1) - rack (>= 0.4) - rack-protection (1.5.3) - rack - -PLATFORMS - ruby - -DEPENDENCIES - rack (~> 1.6.2) - rack-cache (~> 1.1.0) - rack-protection (~> 1.5.0) - -BUNDLED WITH - 1.14.3 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile deleted file mode 100644 index eaaf55a49f..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source :rubygems - -gem "sinatra" -gem "haml" -gem "httparty" -gem "actionpack" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock deleted file mode 100644 index c204545ac4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock +++ /dev/null @@ -1,71 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - actionpack (4.2.5) - actionview (= 4.2.5) - activesupport (= 4.2.5) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.5) - activesupport (= 4.2.5) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activesupport (4.2.5) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - builder (3.2.2) - erubis (2.7.0) - haml (3.1.4) - httparty (0.8.1) - multi_json - multi_xml - i18n (0.7.0) - json (1.8.3) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mini_portile2 (2.1.0) - minitest (5.9.1) - multi_json (1.12.1) - multi_xml (0.5.5) - nokogiri (1.6.8.1) - mini_portile2 (~> 2.1.0) - rack (1.6.4) - rack-protection (1.5.3) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - sinatra (1.3.2) - rack (~> 1.3, >= 1.3.6) - rack-protection (~> 1.2) - tilt (~> 1.3, >= 1.3.3) - thread_safe (0.3.5) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack - haml - httparty - sinatra - -BUNDLED WITH - 1.13.2 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md deleted file mode 100644 index d62f7a14d4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# node-uuid - -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. - -Features: - -* Generate RFC4122 version 1 or version 4 UUIDs -* Runs in node.js and all browsers. -* Cryptographically strong random # generation on supporting platforms -* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) -* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) - -## Getting Started - -Install it in your browser: - -```html - -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.4 -* Improved module context detection -* Removed public RNG functions - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json deleted file mode 100644 index fc6297d963..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "node-uuid@1.4.0", - "_id": "node-uuid@1.4.0", - "_inBundle": false, - "_integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", - "_location": "/node-uuid", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "node-uuid@1.4.0", - "name": "node-uuid", - "escapedName": "node-uuid", - "rawSpec": "1.4.0", - "saveSpec": null, - "fetchSpec": "1.4.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "_spec": "node-uuid@1.4.0", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "deprecated": "Use uuid module instead", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "homepage": "https://github.com/broofa/node-uuid#readme", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "lib": ".", - "main": "./uuid.js", - "name": "node-uuid", - "repository": { - "type": "git", - "url": "git+https://github.com/broofa/node-uuid.git" - }, - "url": "http://github.com/broofa/node-uuid", - "version": "1.4.0" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md deleted file mode 100644 index 78cbe24bd4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md +++ /dev/null @@ -1,38 +0,0 @@ - -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - - require('querystring').parse('user[name][first]=tj&user[email]=tj'); - // => { user: { name: { first: 'tj' }}} - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json deleted file mode 100644 index a03148ff13..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_from": "qs@0.0.6", - "_id": "qs@0.0.6", - "_inBundle": false, - "_integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=", - "_location": "/qs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qs@0.0.6", - "name": "qs", - "escapedName": "qs", - "rawSpec": "0.0.6", - "saveSpec": null, - "fetchSpec": "0.0.6" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "_shasum": "481659b7e5bf6a5ea898010de5aed35eb469e124", - "_spec": "qs@0.0.6", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "querystring parser", - "engines": { - "node": "*" - }, - "main": "index", - "name": "qs", - "repository": {}, - "version": "0.0.6" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/package.json deleted file mode 100644 index 5211b26c8e..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "goof", - "version": "0.0.3", - "description": "A vulnerable todo demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/snyk-todo-list-demo-app/" - }, - "scripts": { - "start": "node app.js", - "cleanup": "mongo express-todo --eval 'db.todos.remove({});'" - }, - "dependencies": { - "body-parser": "1.9.0", - "cookie-parser": "1.3.3", - "ejs": "1.0.0", - "ejs-locals": "1.0.2", - "errorhandler": "1.2.0", - "express": "4.12.4", - "express-fileupload": "0.0.5", - "humanize-ms": "1.0.1", - "marked": "0.3.5", - "method-override": "latest", - "moment": "2.15.1", - "mongoose": "4.2.4", - "morgan": "latest", - "ms": "^0.7.1", - "npmconf": "0.0.24", - "optional": "^0.1.3", - "st": "0.2.4", - "stream-buffers": "^3.0.1", - "tap": "^5.7.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md b/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md deleted file mode 100644 index d62f7a14d4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# node-uuid - -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. - -Features: - -* Generate RFC4122 version 1 or version 4 UUIDs -* Runs in node.js and all browsers. -* Cryptographically strong random # generation on supporting platforms -* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) -* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) - -## Getting Started - -Install it in your browser: - -```html - -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.4 -* Improved module context detection -* Removed public RNG functions - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json b/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json deleted file mode 100644 index fc6297d963..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "node-uuid@1.4.0", - "_id": "node-uuid@1.4.0", - "_inBundle": false, - "_integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", - "_location": "/node-uuid", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "node-uuid@1.4.0", - "name": "node-uuid", - "escapedName": "node-uuid", - "rawSpec": "1.4.0", - "saveSpec": null, - "fetchSpec": "1.4.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "_spec": "node-uuid@1.4.0", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "deprecated": "Use uuid module instead", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "homepage": "https://github.com/broofa/node-uuid#readme", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "lib": ".", - "main": "./uuid.js", - "name": "node-uuid", - "repository": { - "type": "git", - "url": "git+https://github.com/broofa/node-uuid.git" - }, - "url": "http://github.com/broofa/node-uuid", - "version": "1.4.0" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md b/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md deleted file mode 100644 index 78cbe24bd4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md +++ /dev/null @@ -1,38 +0,0 @@ - -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - - require('querystring').parse('user[name][first]=tj&user[email]=tj'); - // => { user: { name: { first: 'tj' }}} - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json b/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json deleted file mode 100644 index a03148ff13..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_from": "qs@0.0.6", - "_id": "qs@0.0.6", - "_inBundle": false, - "_integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=", - "_location": "/qs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qs@0.0.6", - "name": "qs", - "escapedName": "qs", - "rawSpec": "0.0.6", - "saveSpec": null, - "fetchSpec": "0.0.6" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "_shasum": "481659b7e5bf6a5ea898010de5aed35eb469e124", - "_spec": "qs@0.0.6", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "querystring parser", - "engines": { - "node": "*" - }, - "main": "index", - "name": "qs", - "repository": {}, - "version": "0.0.6" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/package.json b/test/acceptance/workspaces/mono-repo-nested/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/jest/acceptance/snyk-test/all-projects.spec.ts b/test/jest/acceptance/snyk-test/all-projects.spec.ts index 0a19fd9c39..fdc4fd6433 100644 --- a/test/jest/acceptance/snyk-test/all-projects.spec.ts +++ b/test/jest/acceptance/snyk-test/all-projects.spec.ts @@ -198,48 +198,6 @@ describe('snyk test --all-projects (mocked server only)', () => { expect(stderr).toEqual(''); }); - test('`test mono-repo-nested --all-projects` defaults to 4 max depth', async () => { - const project = await createProjectFromWorkspace('mono-repo-nested'); - - const { code, stdout, stderr } = await runSnykCLI('test --all-projects', { - cwd: project.path(), - env, - }); - - const backendRequests = server.getRequests().filter((req: any) => { - return req.url.includes('/api/v1/test'); - }); - - expect(backendRequests).toHaveLength(4); - backendRequests.forEach((req: any) => { - expect(req.method).toEqual('POST'); - expect(req.headers['x-snyk-cli-version']).not.toBeUndefined(); - expect(req.url).toMatch('/api/v1/test'); - }); - - expect(code).toEqual(0); - - const dirSeparator = process.platform === 'win32' ? '\\' : '/'; - - expect(stdout).toMatch('Target file: package-lock.json'); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}package.json`, - ); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}level-2${dirSeparator}Gemfile.lock`, - ); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}package-lock.json`, - ); - expect(stdout).not.toMatch( - `level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}level-4${dirSeparator}level-5${dirSeparator}package-lock.json`, - ); - expect(stdout).not.toMatch( - `level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}level-4${dirSeparator}level-5${dirSeparator}level-6${dirSeparator}Gemfile.lock`, - ); - expect(stderr).toBe(''); - }); - test('`test empty --all-projects`', async () => { const project = await createProjectFromWorkspace('empty'); diff --git a/test/tap/find-files.test.ts b/test/tap/find-files.test.ts index 131f4629cd..c2d2410631 100644 --- a/test/tap/find-files.test.ts +++ b/test/tap/find-files.test.ts @@ -2,13 +2,9 @@ import * as path from 'path'; import { test } from 'tap'; import { find } from '../../src/lib/find-files'; import { getFixturePath } from '../jest/util/getFixturePath'; -import { getWorkspacePath } from '../jest/util/getWorkspacePath'; const testFixture = getFixturePath('find-files'); -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const skiptest = (name, _) => console.log(`Skipping ${name}`); - test('find all files in test fixture', async (t) => { // six levels deep to find all const { files: result, allFilesFound } = await find({ @@ -75,26 +71,6 @@ test('find all files in test fixture', async (t) => { ); }); -test('defaults to only detecting files up to 4 layers deep when undefined', async (t) => { - // - const { files: result } = await find({ - path: getWorkspacePath('mono-repo-nested'), - levelsDeep: undefined, - }); - - t.same(result.length, 4); -}); - -test('defaults to only detecting files up to 4 layers deep when null', async (t) => { - // - const { files: result } = await find({ - path: getWorkspacePath('mono-repo-nested'), - levelsDeep: NaN, - }); - - t.same(result.length, 4); -}); - test('find all files in test fixture ignoring node_modules', async (t) => { // six levels deep to ensure node_modules is tested const { files: result } = await find({