Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .deps/EXCLUDED/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,25 @@ This file contains a manual contribution to .deps/dev.md and it's needed because
| `@rollup/[email protected]` | transitive dependency |
| `@rollup/[email protected]` | transitive dependency |
| `@rollup/[email protected]` | transitive dependency |
| `@emnapi/[email protected]` | transitive dependency |
| `@emnapi/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `@unrs/[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
212 changes: 118 additions & 94 deletions .deps/dev.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/jest": "^30.0.0",
"@types/node": "^20.11.30",
"axios": "^1.13.1",
"eslint": "^9.5.0",
"if-env": "^1.0.4",
"jest": "^29.7.0",
"jest": "^30.2.0",
"prettier": "^3.3.2",
"rimraf": "^6.0.1",
"rollup": "^4.18.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/devfile-schema/devfile-schema-validator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('DevfileValidator', () => {
};
const version = '3.0.0';

expect(() => validator.validateDevfile(devfile, version)).toThrowError(
expect(() => validator.validateDevfile(devfile, version)).toThrow(
`Dev Workspace generator tool doesn't support devfile version: ${version}`,
);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/devfile/dev-container-component-finder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ describe('Test DevContainerComponentFinder', () => {
} as DevfileContext;
const devWorkspaceSpecTemplateComponents = await devContainerComponentFinder.find(devfileContext);
expect(devWorkspaceSpecTemplateComponents?.name).toBe('my-container-1');
expect(console.warn).toBeCalledWith(
expect(console.warn).toHaveBeenCalledWith(
'More than one dev container component has been potentially found, taking the first one of my-container-1,my-container-2',
);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/editor/editor-resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Test EditorResolver', () => {
const dummy = { dummyContent: 'dummy' };
urlFetcherFetchTextMock.mockResolvedValue(jsYaml.dump(dummy));
const content = await editorResolver.loadEditor(myId);
expect(urlFetcherFetchTextMock).toBeCalledWith('http://editor.yaml');
expect(urlFetcherFetchTextMock).toHaveBeenCalledWith('http://editor.yaml');
expect(content).toStrictEqual(dummy);
});
});
6 changes: 3 additions & 3 deletions tests/entrypoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Test Entrypoint', () => {
test('entrypoint', async () => {
startMethodMock.mockResolvedValue(true);
await require('../src/entrypoint');
expect(startMethodMock).toBeCalled();
expect(startMethodMock).toHaveBeenCalled();
expect(process.exitCode).toBeUndefined();
});

Expand All @@ -47,7 +47,7 @@ describe('Test Entrypoint', () => {
spyExit.mockReturnValue(value);
await require('../src/entrypoint');
startMethodMock.mockResolvedValue(false);
expect(spyExit).toBeCalled();
expect(startMethodMock).toBeCalled();
expect(spyExit).toHaveBeenCalled();
expect(startMethodMock).toHaveBeenCalled();
});
});
8 changes: 4 additions & 4 deletions tests/fetch/url-fetcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,28 @@ describe('Test UrlFetcher', () => {
const content = 'abcd';
axiosGetMock.mockResolvedValue({ data: content });
const value = await urlFetcher.fetchTextOptionalContent('http://fake-entry');
expect(axiosGetMock).toBeCalledWith('http://fake-entry', { responseType: 'text' });
expect(axiosGetMock).toHaveBeenCalledWith('http://fake-entry', { responseType: 'text' });
expect(value).toBe(content);
});

test('basic 404 error empty fetchTextOptionalContent', async () => {
axiosGetMock.mockImplementation(() => Promise.reject(new Custom404Error()));
const value = await urlFetcher.fetchTextOptionalContent('http://fake-entry');
expect(axiosGetMock).toBeCalledWith('http://fake-entry', { responseType: 'text' });
expect(axiosGetMock).toHaveBeenCalledWith('http://fake-entry', { responseType: 'text' });
expect(value).toBeUndefined();
});

test('basic 500 error empty fetchTextOptionalContent', async () => {
axiosGetMock.mockImplementation(() => Promise.reject(new Custom500Error()));
await expect(urlFetcher.fetchTextOptionalContent('http://fake-entry')).rejects.toThrow();
expect(axiosGetMock).toBeCalledWith('http://fake-entry', { responseType: 'text' });
expect(axiosGetMock).toHaveBeenCalledWith('http://fake-entry', { responseType: 'text' });
});

test('basic fetchText', async () => {
const content = 'abcd';
axiosGetMock.mockResolvedValue({ data: content });
const value = await urlFetcher.fetchText('http://fake-entry');
expect(axiosGetMock).toBeCalledWith('http://fake-entry', { responseType: 'text' });
expect(axiosGetMock).toHaveBeenCalledWith('http://fake-entry', { responseType: 'text' });
expect(value).toBe(content);
});
});
16 changes: 8 additions & 8 deletions tests/generate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent);
// expect not to write the file
expect(fsWriteFileSpy).not.toBeCalled();
expect(fsWriteFileSpy).not.toHaveBeenCalled();
expect(JSON.stringify(context.devfile)).toEqual(
'{"schemaVersion":"2.2.0","metadata":{"name":"my-dummy-project"},"parent":{"id":"udi","registryUrl":"https://dummy-registry.io/","version":"1.2.0"}}',
);
Expand Down Expand Up @@ -118,7 +118,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent);
// expect not to write the file
expect(fsWriteFileSpy).not.toBeCalled();
expect(fsWriteFileSpy).not.toHaveBeenCalled();
const expectedDevWorkspace = {
apiVersion: 'workspace.devfile.io/v1alpha2',
kind: 'DevWorkspace',
Expand Down Expand Up @@ -191,7 +191,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent);
// expect not to write the file
expect(fsWriteFileSpy).not.toBeCalled();
expect(fsWriteFileSpy).not.toHaveBeenCalled();
const expectedDevWorkspace = {
apiVersion: 'workspace.devfile.io/v1alpha2',
kind: 'DevWorkspace',
Expand Down Expand Up @@ -259,7 +259,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent);
// expect not to write the file
expect(fsWriteFileSpy).not.toBeCalled();
expect(fsWriteFileSpy).not.toHaveBeenCalled();
expect(JSON.stringify(context.devfile)).toEqual(
'{"schemaVersion":"2.2.0","metadata":{"name":"my-dummy-project"},"components":[{"name":"dev-container","mountSources":true,"container":{"image":"quay.io/foo/bar"}}]}',
);
Expand Down Expand Up @@ -323,7 +323,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent);
// expect not to write the file
expect(fsWriteFileSpy).not.toBeCalled();
expect(fsWriteFileSpy).not.toHaveBeenCalled();
expect(JSON.stringify(context.devfile)).toEqual(
'{"schemaVersion":"2.2.0","metadata":{"generateName":"custom-project"},"components":[{"name":"dev-container","mountSources":true,"container":{"image":"quay.io/foo/bar"}}]}',
);
Expand Down Expand Up @@ -388,7 +388,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent, fakeoutputDir);
// expect to write the file
expect(fsWriteFileSpy).toBeCalled();
expect(fsWriteFileSpy).toHaveBeenCalled();
expect(JSON.stringify(context.devfile)).toEqual(
'{"schemaVersion":"2.2.0","metadata":{"name":"my-dummy-project"},"components":[{"name":"dev-container","mountSources":true,"container":{"image":"quay.io/foo/bar"}}]}',
);
Expand Down Expand Up @@ -453,7 +453,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent, fakeoutputDir, 'false');
// expect to write the file
expect(fsWriteFileSpy).toBeCalled();
expect(fsWriteFileSpy).toHaveBeenCalled();
expect(JSON.stringify(context.devfile)).toEqual(
'{"schemaVersion":"2.2.0","metadata":{"name":"my-dummy-project"},"components":[{"name":"dev-container","attributes":{"old":"attribute"},"mountSources":true,"container":{"image":"quay.io/foo/bar"}}]}',
);
Expand Down Expand Up @@ -519,7 +519,7 @@ metadata:

let context = await generate.generate(devfileContent, editorContent, fakeoutputDir, 'false');
// expect to write the file
expect(fsWriteFileSpy).toBeCalled();
expect(fsWriteFileSpy).toHaveBeenCalled();
expect(context.suffix).toEqual('');
});
});
Expand Down
Loading