Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganitzsh committed Nov 13, 2023
1 parent fc0915c commit 1c5b329
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
env:
GITHUB_EVENT_NAME: push
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
- name: Test
run: npm run test:ci
Expand Down
10 changes: 10 additions & 0 deletions src/release.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { $ } from 'execa';

import { gitCommits, gitPush, gitRepo } from './utilities/git.js';

jest.setTimeout(10_000);

const execSpy = jest.fn() as unknown as jest.SpiedFunction<
(typeof import('@actions/exec'))['exec']
>;
Expand Down Expand Up @@ -34,6 +36,13 @@ const optionsOverride = {
verifyRelease: (jest.fn() as JestSpyBooleanPromise).mockResolvedValue(true),
};

beforeAll((): void => {
// eslint-disable-next-line functional/immutable-data
process.env.GITHUB_EVENT_NAME = 'push';
// eslint-disable-next-line functional/immutable-data
process.env.GITHUB_REF = 'master';
});

beforeEach(async (): Promise<void> => {
await $`git config --global init.defaultBranch master`;

Expand Down Expand Up @@ -103,6 +112,7 @@ describe('release', (): void => {

// Generate git
const { cwd } = await gitRepo();

await gitCommits(
['feat: add a major change\n\nBREAKING CHANGE: break something'],
{ cwd },
Expand Down
1 change: 0 additions & 1 deletion src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const release = async (
/* istanbul ignore next */
const defaultOptions = {
...(branches === undefined ? {} : { branches }),
ci: false,
dryRun: processInputDryRun(),
plugins: generatePlugins({
commitAssets: processInputCommitAssets(),
Expand Down

0 comments on commit 1c5b329

Please sign in to comment.