diff --git a/src/expo.ts b/src/expo.ts index a949520..be4dc2b 100644 --- a/src/expo.ts +++ b/src/expo.ts @@ -1,6 +1,6 @@ import detectIndent from 'detect-indent'; import detectNewline from 'detect-newline'; -import { readFile, readJson, writeJson } from 'fs-extra'; +import { readFile, writeJson } from 'fs-extra'; import { Context } from './types'; /** diff --git a/src/types.ts b/src/types.ts index adcda7c..bb34a0b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,3 @@ -import { SemVer } from 'semver'; import { Manifest, ManifestMeta } from './expo'; /** @@ -52,8 +51,8 @@ export interface Context { nextRelease?: NextRelease; /** The shared logger instance of semantic release. */ logger: { - log: (message: string, ...vars: any[]) => void, - error: (message: string, ...vars: any[]) => void, + log: (message: string, ...vars: any[]) => void; + error: (message: string, ...vars: any[]) => void; }; } diff --git a/test/factory.ts b/test/factory.ts index f01c67f..8eb8475 100644 --- a/test/factory.ts +++ b/test/factory.ts @@ -9,18 +9,6 @@ export function createConfig(): Config { return {}; } -/** - * Create a (full) context object with logger, options and last/next releases. - */ -export function createContext(options: { next?: NextRelease, last?: LastRelease } = {}): Context { - return { - ...createContextLogger(), - ...createContextOptions(), - ...createContextNextRelease(options.next), - ...createContextLastRelease(options.last), - }; -} - /** * Create a context partial with a mocked logger. */ @@ -83,3 +71,15 @@ export function createManifestMeta(manifest: Manifest): ManifestMeta { manifest, }; } + +/** + * Create a (full) context object with logger, options and last/next releases. + */ +export function createContext(options: { next?: NextRelease; last?: LastRelease } = {}): Context { + return { + ...createContextLogger(), + ...createContextOptions(), + ...createContextNextRelease(options.next), + ...createContextLastRelease(options.last), + }; +} diff --git a/test/scripts/verify-conditions.test.ts b/test/scripts/verify-conditions.test.ts index fd875a5..ae76fd9 100644 --- a/test/scripts/verify-conditions.test.ts +++ b/test/scripts/verify-conditions.test.ts @@ -5,9 +5,6 @@ jest.doMock('../../src/expo', () => ({ readManifests, MANIFEST_FILE: 'app.json' import verifyConditions from '../../src/scripts/verify-conditions'; import { createContext } from '../factory'; -// tslint:disable-next-line:no-var-requires -const SemanticReleaseError = require('@semantic-release/error'); - describe('scripts/verify-conditions', () => { it('reads manifest and logs name', async () => { const context = createContext();