-
Notifications
You must be signed in to change notification settings - Fork 4
deps: Upgrade dependencies to address vurnabilities. #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { assert } from 'chai'; | ||
| import * as fs from 'fs-extra'; | ||
| import * as path from '../../../platform/vscode-path/path'; | ||
| import * as os from 'os'; | ||
| import { FileSystem } from './fileSystem.node'; | ||
|
|
||
| suite('FileSystem - glob functionality', () => { | ||
| let fileSystem: FileSystem; | ||
| let tempDir: string; | ||
|
|
||
| setup(async () => { | ||
| fileSystem = new FileSystem(); | ||
| tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-deepnote-test-')); | ||
| }); | ||
|
|
||
| teardown(async () => { | ||
| await fs.remove(tempDir); | ||
| }); | ||
|
|
||
| test('searchLocal should find files matching pattern', async () => { | ||
| // Create test files | ||
| await fs.writeFile(path.join(tempDir, 'test1.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'test2.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'test.js'), 'content'); | ||
|
|
||
| const results = await fileSystem.searchLocal('*.ts', tempDir); | ||
|
|
||
| assert.strictEqual(results.length, 2); | ||
| assert.ok(results.some((f) => f.endsWith('test1.ts'))); | ||
| assert.ok(results.some((f) => f.endsWith('test2.ts'))); | ||
| }); | ||
|
|
||
| test('searchLocal should find files in subdirectories with ** pattern', async () => { | ||
| // Create test files in subdirectories | ||
| await fs.ensureDir(path.join(tempDir, 'sub1')); | ||
| await fs.ensureDir(path.join(tempDir, 'sub2')); | ||
| await fs.writeFile(path.join(tempDir, 'sub1', 'test1.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'sub2', 'test2.ts'), 'content'); | ||
|
|
||
| const results = await fileSystem.searchLocal('**/*.ts', tempDir); | ||
|
|
||
| assert.strictEqual(results.length, 2); | ||
| assert.ok(results.some((f) => f.includes('sub1') && f.endsWith('test1.ts'))); | ||
| assert.ok(results.some((f) => f.includes('sub2') && f.endsWith('test2.ts'))); | ||
| }); | ||
|
|
||
| test('searchLocal should find hidden files when dot option is true', async () => { | ||
| // Create hidden file | ||
| await fs.writeFile(path.join(tempDir, '.hidden.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'visible.ts'), 'content'); | ||
|
|
||
| const results = await fileSystem.searchLocal('*.ts', tempDir, true); | ||
|
|
||
| assert.ok(results.length >= 2); | ||
| assert.ok(results.some((f) => f.endsWith('.hidden.ts'))); | ||
| assert.ok(results.some((f) => f.endsWith('visible.ts'))); | ||
| }); | ||
|
|
||
| test('searchLocal should not find hidden files when dot option is false', async () => { | ||
| // Create hidden file | ||
| await fs.writeFile(path.join(tempDir, '.hidden.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'visible.ts'), 'content'); | ||
|
|
||
| const results = await fileSystem.searchLocal('*.ts', tempDir, false); | ||
|
|
||
| assert.strictEqual(results.length, 1); | ||
| assert.ok(results.some((f) => f.endsWith('visible.ts'))); | ||
| assert.ok(!results.some((f) => f.endsWith('.hidden.ts'))); | ||
| }); | ||
|
|
||
| test('searchLocal should return empty array when no files match', async () => { | ||
| const results = await fileSystem.searchLocal('*.nonexistent', tempDir); | ||
|
|
||
| assert.strictEqual(results.length, 0); | ||
| }); | ||
|
|
||
| test('searchLocal should handle patterns with multiple extensions', async () => { | ||
| await fs.writeFile(path.join(tempDir, 'test.ts'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'test.js'), 'content'); | ||
| await fs.writeFile(path.join(tempDir, 'test.py'), 'content'); | ||
|
|
||
| const results = await fileSystem.searchLocal('*.{ts,js}', tempDir); | ||
|
|
||
| assert.strictEqual(results.length, 2); | ||
| assert.ok(results.some((f) => f.endsWith('.ts'))); | ||
| assert.ok(results.some((f) => f.endsWith('.js'))); | ||
| assert.ok(!results.some((f) => f.endsWith('.py'))); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
Artmann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /* eslint-disable local-rules/dont-use-process */ | ||
|
|
||
| import { assert } from 'chai'; | ||
| import * as path from '../../platform/vscode-path/path'; | ||
| import * as fs from 'fs-extra'; | ||
| import * as os from 'os'; | ||
| import { getCondaFile } from './condaService.node'; | ||
| import { glob } from 'glob'; | ||
|
|
||
| suite('condaService - glob functionality', () => { | ||
| let originalEnv: string | undefined; | ||
| let tempDir: string; | ||
|
|
||
| setup(async () => { | ||
| // Save original environment variable | ||
| originalEnv = process.env.CI_PYTHON_CONDA_PATH; | ||
| delete process.env.CI_PYTHON_CONDA_PATH; | ||
|
|
||
| // Create a temporary directory for testing | ||
| tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'conda-test-')); | ||
| }); | ||
|
|
||
| teardown(async () => { | ||
| // Restore environment variable | ||
| if (originalEnv !== undefined) { | ||
| process.env.CI_PYTHON_CONDA_PATH = originalEnv; | ||
| } else { | ||
| delete process.env.CI_PYTHON_CONDA_PATH; | ||
| } | ||
|
|
||
| // Clean up temp directory | ||
| await fs.remove(tempDir); | ||
| }); | ||
|
|
||
| test('getCondaFile should use CI_PYTHON_CONDA_PATH when set', async () => { | ||
| process.env.CI_PYTHON_CONDA_PATH = '/custom/conda/path'; | ||
|
|
||
| const result = await getCondaFile(); | ||
|
|
||
| assert.strictEqual(result, '/custom/conda/path'); | ||
| }); | ||
|
|
||
| test('glob should work with basic patterns', async () => { | ||
| // Create test files | ||
| await fs.writeFile(path.join(tempDir, 'conda'), 'test'); | ||
| await fs.writeFile(path.join(tempDir, 'python'), 'test'); | ||
|
|
||
| const results = await glob('conda', { cwd: tempDir }); | ||
|
|
||
| assert.strictEqual(results.length, 1); | ||
| assert.ok(results[0].includes('conda')); | ||
| }); | ||
|
|
||
| test('glob should work with wildcard patterns', async () => { | ||
| // Create test files | ||
| await fs.writeFile(path.join(tempDir, 'conda1'), 'test'); | ||
| await fs.writeFile(path.join(tempDir, 'conda2'), 'test'); | ||
| await fs.writeFile(path.join(tempDir, 'python'), 'test'); | ||
|
|
||
| const results = await glob('conda*', { cwd: tempDir }); | ||
|
|
||
| assert.strictEqual(results.length, 2); | ||
| }); | ||
|
|
||
| test('glob should handle brace expansion patterns', async () => { | ||
| // Create test files | ||
| await fs.writeFile(path.join(tempDir, 'conda'), 'test'); | ||
| await fs.writeFile(path.join(tempDir, 'miniconda'), 'test'); | ||
| await fs.writeFile(path.join(tempDir, 'python'), 'test'); | ||
|
|
||
| const results = await glob('{conda,miniconda}', { cwd: tempDir }); | ||
|
|
||
| assert.strictEqual(results.length, 2); | ||
| assert.ok(results.some((r) => r.includes('conda'))); | ||
| assert.ok(results.some((r) => r.includes('miniconda'))); | ||
| }); | ||
|
|
||
| test('glob should return empty array when no matches found', async () => { | ||
| const results = await glob('nonexistent*', { cwd: tempDir }); | ||
|
|
||
| assert.strictEqual(results.length, 0); | ||
| }); | ||
|
|
||
| test('glob should handle errors gracefully with catch', async () => { | ||
| const results = await glob('/nonexistent/path/**/*', {}).catch(() => []); | ||
|
|
||
| assert.deepStrictEqual(results, []); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.