Skip to content

Commit

Permalink
fix: all new eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jul 13, 2019
1 parent 845172d commit ab47e35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/expo.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
5 changes: 2 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { SemVer } from 'semver';
import { Manifest, ManifestMeta } from './expo';

/**
Expand Down Expand Up @@ -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;
};
}

Expand Down
24 changes: 12 additions & 12 deletions test/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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),
};
}
3 changes: 0 additions & 3 deletions test/scripts/verify-conditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ab47e35

Please sign in to comment.