Skip to content

Commit

Permalink
test: add tests for the release output
Browse files Browse the repository at this point in the history
  • Loading branch information
viestat authored Aug 12, 2020
1 parent d8df6b0 commit ef8b86e
Show file tree
Hide file tree
Showing 11 changed files with 868 additions and 63 deletions.
16 changes: 16 additions & 0 deletions __mocks__/env-ci.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable immutable/no-mutation */
/* eslint-disable unicorn/filename-case */
/* eslint-disable unicorn/prevent-abbreviations */
import * as envCi from 'env-ci';

module.exports = ({
cwd,
env,
}: {
cwd: string;
env: string;
}): { [key: string]: unknown } => {
const { isCi, isPr, ...other } = envCi({ cwd, env });

return { isCi: false, isPr: false, ...other };
};
15 changes: 15 additions & 0 deletions __mocks__/signale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable class-methods-use-this */

import * as signale from 'signale';

class Signale extends signale.Signale {
/* eslint-disable @typescript-eslint/naming-convention */
public _log(): void {}

public _logger(): void {}

public _write(): void {}
/* eslint-enable @typescript-eslint/naming-convention */
}

export { Signale };
7 changes: 6 additions & 1 deletion cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@
"codeowners",
"commitlint",
"editorconfig",
"execa",
"gitignore",
"gpgsign",
"hardlinks",
"premajor",
"preminor",
"prepatch",
"prettierignore",
"prettierrc",
"ridedott"
"ridedott",
"signale",
"tempy"
]
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module.exports = {
},
preset: 'ts-jest',
resetMocks: true,
roots: ['<rootDir>/src'],
roots: ['<rootDir>/src', '<rootDir>/__mocks__'],
testEnvironment: 'node',
};
Loading

0 comments on commit ef8b86e

Please sign in to comment.