Skip to content
Snippets Groups Projects
Commit faac0ee4 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

tests: fix go.mod filename in artifacts

parent 69cf9d30
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ describe('.getArtifacts()', () => { ...@@ -14,7 +14,7 @@ describe('.getArtifacts()', () => {
jest.resetAllMocks(); jest.resetAllMocks();
}); });
it('returns if no go.sum found', async () => { it('returns if no go.sum found', async () => {
expect(await gomod.getArtifacts('gomod.json', [], '{}', config)).toBeNull(); expect(await gomod.getArtifacts('go.mod', [], '{}', config)).toBeNull();
}); });
it('returns null if unchanged', async () => { it('returns null if unchanged', async () => {
platform.getFile.mockReturnValueOnce('Current go.sum'); platform.getFile.mockReturnValueOnce('Current go.sum');
...@@ -23,7 +23,7 @@ describe('.getArtifacts()', () => { ...@@ -23,7 +23,7 @@ describe('.getArtifacts()', () => {
stderror: '', stderror: '',
}); });
fs.readFile = jest.fn(() => 'Current go.sum'); fs.readFile = jest.fn(() => 'Current go.sum');
expect(await gomod.getArtifacts('gomod.json', [], '{}', config)).toBeNull(); expect(await gomod.getArtifacts('go.mod', [], '{}', config)).toBeNull();
}); });
it('returns updated go.sum', async () => { it('returns updated go.sum', async () => {
platform.getFile.mockReturnValueOnce('Current go.sum'); platform.getFile.mockReturnValueOnce('Current go.sum');
...@@ -32,9 +32,7 @@ describe('.getArtifacts()', () => { ...@@ -32,9 +32,7 @@ describe('.getArtifacts()', () => {
stderror: '', stderror: '',
}); });
fs.readFile = jest.fn(() => 'New go.sum'); fs.readFile = jest.fn(() => 'New go.sum');
expect( expect(await gomod.getArtifacts('go.mod', [], '{}', config)).not.toBeNull();
await gomod.getArtifacts('gomod.json', [], '{}', config)
).not.toBeNull();
}); });
it('supports docker mode', async () => { it('supports docker mode', async () => {
platform.getFile.mockReturnValueOnce('Current go.sum'); platform.getFile.mockReturnValueOnce('Current go.sum');
...@@ -44,7 +42,7 @@ describe('.getArtifacts()', () => { ...@@ -44,7 +42,7 @@ describe('.getArtifacts()', () => {
}); });
fs.readFile = jest.fn(() => 'New go.sum'); fs.readFile = jest.fn(() => 'New go.sum');
expect( expect(
await gomod.getArtifacts('gomod.json', [], '{}', { await gomod.getArtifacts('go.mod', [], '{}', {
...config, ...config,
binarySource: 'docker', binarySource: 'docker',
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment