Skip to content

Commit

Permalink
fix(schematics): rename skipTest to skipTests
Browse files Browse the repository at this point in the history
fixes ngrx#2521
  • Loading branch information
Arkadiusz Szechlicki committed May 12, 2020
1 parent 8f8e188 commit f46f44e
Show file tree
Hide file tree
Showing 44 changed files with 56 additions and 60 deletions.
12 changes: 5 additions & 7 deletions modules/effects/schematics/ng-add/index.spec.ts
Expand Up @@ -124,8 +124,8 @@ describe('Effects ng-add Schematic', () => {
expect(thrownError).toBeDefined();
});

it('should respect the skipTest flag', () => {
const options = { ...defaultOptions, skipTest: true };
it('should respect the skipTests flag', () => {
const options = { ...defaultOptions, skipTests: true };

const tree = schematicRunner.runSchematic('ng-add', options, appTree);
const files = tree.files;
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('Effects ng-add Schematic', () => {
const options = {
...defaultOptions,
flat: true,
skipTest: true,
skipTests: true,
group: true,
};

Expand All @@ -215,16 +215,14 @@ describe('Effects ng-add Schematic', () => {
});

it('should inject the effect service correctly', async () => {
const options = { ...defaultOptions, skipTest: false };
const options = { ...defaultOptions, skipTests: false };
const tree = await schematicRunner
.runSchematicAsync('ng-add', options, appTree)
.toPromise();
const content = tree.readContent(
`${projectPath}/src/app/foo/foo.effects.spec.ts`
);

expect(content).toMatch(
/effects = TestBed\.inject\(FooEffects\);/
);
expect(content).toMatch(/effects = TestBed\.inject\(FooEffects\);/);
});
});
2 changes: 1 addition & 1 deletion modules/effects/schematics/ng-add/index.ts
Expand Up @@ -129,7 +129,7 @@ export default function(options: EffectOptions): Rule {
options.path = parsedPath.path;

const templateSource = apply(url('./files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
options.minimal ? filter(_ => false) : noop(),
Expand Down
2 changes: 1 addition & 1 deletion modules/effects/schematics/ng-add/schema.json
Expand Up @@ -26,7 +26,7 @@
"default": true,
"description": "Flag to indicate if a dir is created."
},
"skipTest": {
"skipTests": {
"type": "boolean",
"default": false,
"description": "When true, does not create test files."
Expand Down
2 changes: 1 addition & 1 deletion modules/effects/schematics/ng-add/schema.ts
Expand Up @@ -3,7 +3,7 @@ export interface Schema {
skipPackageJson?: boolean;
path?: string;
flat?: boolean;
skipTest?: boolean;
skipTests?: boolean;
project?: string;
module?: string;
group?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions modules/schematics/src/action/index.spec.ts
Expand Up @@ -73,10 +73,10 @@ describe('Action Schematic', () => {
).toBeGreaterThanOrEqual(0);
});

it('should not create test files when skipTest is set to true', () => {
it('should not create test files when skipTests is set to true', () => {
const options = {
...defaultOptions,
skipTest: true,
skipTests: true,
};
const tree = schematicRunner.runSchematic('action', options, appTree);
expect(
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/action/index.ts
Expand Up @@ -32,7 +32,7 @@ export default function(options: ActionOptions): Rule {
const templateSource = apply(
url(options.creators ? './creator-files' : './files'),
[
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates({
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/action/schema.json
Expand Up @@ -24,7 +24,7 @@
"description": "The name of the project.",
"aliases": ["p"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files.",
"default": false
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/action/schema.ts
Expand Up @@ -17,7 +17,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Flag to indicate if a dir is created.
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/container/index.ts
Expand Up @@ -136,7 +136,7 @@ export default function(options: ContainerOptions): Rule {
const templateSource = apply(
url(options.testDepth === 'unit' ? './files' : './integration-files'),
[
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates({
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/container/schema.json
Expand Up @@ -57,7 +57,7 @@
"The file extension or preprocessor to use for style files.",
"type": "string"
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files."
},
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/container/schema.ts
Expand Up @@ -38,7 +38,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;
/**
* Flag to indicate if a dir is created.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/data/index.spec.ts
Expand Up @@ -59,7 +59,7 @@ describe('Data Schematic', () => {
).toBeGreaterThanOrEqual(0);
});

it('should create two files if skipTest is false(as it is by default)', () => {
it('should create two files if skipTests is false(as it is by default)', () => {
const options = {
...defaultOptions,
};
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/data/index.ts
Expand Up @@ -28,7 +28,7 @@ export default function(options: DataOptions): Rule {
options.path = parsedPath.path;

const templateSource = apply(url('./files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates({
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/data/schema.json
Expand Up @@ -23,7 +23,7 @@
"description": "The name of the project.",
"aliases": ["p"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files.",
"default": false
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/data/schema.ts
Expand Up @@ -17,7 +17,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Flag to indicate if a dir is created.
Expand Down
12 changes: 5 additions & 7 deletions modules/schematics/src/effect/index.spec.ts
Expand Up @@ -103,8 +103,8 @@ describe('Effect Schematic', () => {
expect(thrownError).toBeDefined();
});

it('should respect the skipTest flag', () => {
const options = { ...defaultOptions, skipTest: true };
it('should respect the skipTests flag', () => {
const options = { ...defaultOptions, skipTests: true };

const tree = schematicRunner.runSchematic('effect', options, appTree);
const files = tree.files;
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('Effect Schematic', () => {
const options = {
...defaultOptions,
flat: true,
skipTest: true,
skipTests: true,
group: true,
};

Expand All @@ -257,7 +257,7 @@ describe('Effect Schematic', () => {
it('should group and nest the effect within a feature', () => {
const options = {
...defaultOptions,
skipTest: true,
skipTests: true,
group: true,
flat: false,
feature: true,
Expand Down Expand Up @@ -417,8 +417,6 @@ describe('Effect Schematic', () => {
`${projectPath}/src/app/foo/foo.effects.spec.ts`
);

expect(content).toMatch(
/effects = TestBed\.inject\(FooEffects\);/
);
expect(content).toMatch(/effects = TestBed\.inject\(FooEffects\);/);
});
});
2 changes: 1 addition & 1 deletion modules/schematics/src/effect/index.ts
Expand Up @@ -130,7 +130,7 @@ export default function(options: EffectOptions): Rule {
options.path = parsedPath.path;

const templateSource = apply(url('./files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
options.root && options.minimal ? filter(_ => false) : noop(),
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/effect/schema.json
Expand Up @@ -29,7 +29,7 @@
"default": true,
"description": "Flag to indicate if a dir is created."
},
"skipTest": {
"skipTests": {
"type": "boolean",
"default": false,
"description": "When true, does not create test files."
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/effect/schema.ts
Expand Up @@ -22,7 +22,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Allows specification of the declaring module.
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/entity/index.ts
Expand Up @@ -51,7 +51,7 @@ export default function(options: EntityOptions): Rule {
};

const commonTemplates = apply(url('./common-files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates(templateOptions),
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/entity/schema.json
Expand Up @@ -24,7 +24,7 @@
"description": "The name of the project.",
"aliases": ["p"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files.",
"default": false
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/entity/schema.ts
Expand Up @@ -20,7 +20,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;
/**
* Allows specification of the declaring module.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/feature/index.spec.ts
Expand Up @@ -63,7 +63,7 @@ describe('Feature Schematic', () => {
});

it('should not create test files', () => {
const options = { ...defaultOptions, skipTest: true };
const options = { ...defaultOptions, skipTests: true };

const tree = schematicRunner.runSchematic('feature', options, appTree);
const files = tree.files;
Expand Down
8 changes: 4 additions & 4 deletions modules/schematics/src/feature/index.ts
Expand Up @@ -16,7 +16,7 @@ export default function(options: FeatureOptions): Rule {
name: options.name,
path: options.path,
project: options.project,
skipTest: options.skipTest,
skipTests: options.skipTests,
api: options.api,
creators: options.creators,
}),
Expand All @@ -27,7 +27,7 @@ export default function(options: FeatureOptions): Rule {
name: options.name,
path: options.path,
project: options.project,
skipTest: options.skipTest,
skipTests: options.skipTests,
reducers: options.reducers,
feature: true,
api: options.api,
Expand All @@ -40,7 +40,7 @@ export default function(options: FeatureOptions): Rule {
name: options.name,
path: options.path,
project: options.project,
skipTest: options.skipTest,
skipTests: options.skipTests,
feature: true,
api: options.api,
creators: options.creators,
Expand All @@ -51,7 +51,7 @@ export default function(options: FeatureOptions): Rule {
name: options.name,
path: options.path,
project: options.project,
skipTest: options.skipTest,
skipTests: options.skipTests,
feature: true,
}),
])(host, context);
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/feature/schema.json
Expand Up @@ -34,7 +34,7 @@
"description": "Specifies the declaring module.",
"aliases": ["m"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"default": false,
"description": "When true, does not create test files."
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/feature/schema.ts
Expand Up @@ -22,7 +22,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Allows specification of the declaring module.
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/reducer/index.spec.ts
Expand Up @@ -272,7 +272,7 @@ describe('Reducer Schematic', () => {
it('should group and nest the reducer within a feature', () => {
const options = {
...defaultOptions,
skipTest: true,
skipTests: true,
group: true,
flat: false,
feature: true,
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/reducer/index.ts
Expand Up @@ -50,7 +50,7 @@ export default function(options: ReducerOptions): Rule {
};

const commonTemplate = apply(url('./common-files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates(templateOptions),
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/reducer/schema.json
Expand Up @@ -24,7 +24,7 @@
"description": "The name of the project.",
"aliases": ["p"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files.",
"default": false
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/reducer/schema.ts
Expand Up @@ -22,7 +22,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Allows specification of the declaring module.
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/selector/index.spec.ts
Expand Up @@ -61,7 +61,7 @@ describe('Selector Schematic', () => {
it('should not create a spec file if spec is false', () => {
const options = {
...defaultOptions,
skipTest: true,
skipTests: true,
};
const tree = schematicRunner.runSchematic('selector', options, appTree);

Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/selector/index.ts
Expand Up @@ -28,7 +28,7 @@ export default function(options: SelectorOptions): Rule {
options.path = parsedPath.path;

const templateSource = apply(url('./files'), [
options.skipTest
options.skipTests
? filter(path => !path.endsWith('.spec.ts.template'))
: noop(),
applyTemplates({
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/selector/schema.json
Expand Up @@ -23,7 +23,7 @@
"description": "The name of the project.",
"aliases": ["p"]
},
"skipTest": {
"skipTests": {
"type": "boolean",
"description": "When true, does not create test files.",
"default": false
Expand Down
2 changes: 1 addition & 1 deletion modules/schematics/src/selector/schema.ts
Expand Up @@ -22,7 +22,7 @@ export interface Schema {
/**
* When true, does not create test files.
*/
skipTest?: boolean;
skipTests?: boolean;

/**
* Specifies if this is grouped within a feature
Expand Down

0 comments on commit f46f44e

Please sign in to comment.