Skip to content

Commit

Permalink
test: fix existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Dec 14, 2021
1 parent 81c44b9 commit a7348a7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ beforeAll(() => {

jest.spyOn(github.context, 'repo', 'get').mockImplementation(() => {
return {
owner: 'enriikke',
repo: 'enriikke.github.io',
owner: 'foo',
repo: 'foo.github.io',
};
});

Expand All @@ -53,7 +53,6 @@ beforeEach(() => {
jest.resetModules();
inputs = {
'access-token': 'SECRET',
'skip-publish': 'true',
};
});

Expand All @@ -76,19 +75,21 @@ describe('scully Publish action', () => {
await expect(run()).resolves.not.toThrowError();
});

it('calls scully build without args', async () => {
it('calls angular build without args', async () => {
inputs['build-args'] = '';
inputs['scully-args'] = '';

await run();

expect(execSpy).toBeCalledWith('yarn run build', []);
expect(execSpy).toHaveBeenLastCalledWith('yarn run build ', []);
});

it('calls scully build with args', async () => {
inputs['scully-args'] = '--prefix-paths --no-uglify';
it('calls angular build with args', async () => {
inputs['build-args'] = '--prefix-paths --no-uglify';
inputs['scully-args'] = '';

await run();

expect(execSpy).toBeCalledWith('yarn run build', ['--', '--prefix-paths', '--no-uglify']);
expect(execSpy).toHaveBeenLastCalledWith('yarn run build -- --prefix-paths --no-uglify', []);
});
});

0 comments on commit a7348a7

Please sign in to comment.