chore(repo): setup internal testing utils structure (#17043)
This commit is contained in:
parent
c7a6b4ba6c
commit
cac64d7a8b
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
|
||||
describe('Angular migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
|
||||
describe('Cypress migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators || {}).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
|
||||
describe('Detox migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
|
||||
3
packages/devkit/internal-testing-utils.ts
Normal file
3
packages/devkit/internal-testing-utils.ts
Normal file
@ -0,0 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-restricted-imports */
|
||||
export * from 'nx/internal-testing-utils/assert-valid-migrations';
|
||||
export * from 'nx/internal-testing-utils/run-migration-against-this-workspace';
|
||||
7
packages/devkit/migrations.spec.ts
Normal file
7
packages/devkit/migrations.spec.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from './internal-testing-utils';
|
||||
|
||||
describe('Devkit migrations', () => {
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
@ -1,3 +1,4 @@
|
||||
import { assertRunsAgainstNxRepo } from 'nx/internal-testing-utils/run-migration-against-this-workspace';
|
||||
import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace';
|
||||
import { Tree } from 'nx/src/generators/tree';
|
||||
import { readJson, updateJson } from 'nx/src/generators/utils/json';
|
||||
@ -35,4 +36,6 @@ describe('update-16-0-0-add-nx-packages', () => {
|
||||
|
||||
expect(newDependencyVersion).toBeDefined();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(replacePackage);
|
||||
});
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
"**/*.test.ts",
|
||||
"**/*_spec.ts",
|
||||
"**/*_test.ts",
|
||||
"internal-testing-utils.ts",
|
||||
"jest.config.ts"
|
||||
],
|
||||
"files": ["./index.d.ts"],
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"**/*.spec.jsx",
|
||||
"**/*.test.jsx",
|
||||
"**/*.d.ts",
|
||||
"internal-testing-utils.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,14 +1,7 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
|
||||
describe('esbuild migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
|
||||
7
packages/eslint-plugin/migrations.spec.ts
Normal file
7
packages/eslint-plugin/migrations.spec.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
|
||||
describe('eslint-plugin migrations', () => {
|
||||
assertValidMigrationPaths(json, __dirname);
|
||||
});
|
||||
8
packages/expo/migrations.spec.ts
Normal file
8
packages/expo/migrations.spec.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import json = require('./migrations.json');
|
||||
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('expo migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
@ -1,14 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
describe('Express migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('express migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Jest migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('jest migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
describe('JS migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('js migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Linter migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('linter migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Nest migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('nest migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Next migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('next migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Node migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('node migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
import {
|
||||
MigrationsJson,
|
||||
MigrationsJsonEntry,
|
||||
} from '../src/config/misc-interfaces';
|
||||
import * as path from 'path';
|
||||
|
||||
export function assertValidMigrationPaths(json: MigrationsJson, root: string) {
|
||||
Object.entries(json.generators).forEach(([generator, m]) => {
|
||||
it(`should have valid path generator: ${generator}`, () => {
|
||||
validateMigration(m, root);
|
||||
});
|
||||
});
|
||||
|
||||
Object.entries(json.schematics ?? {}).forEach(([schematic, m]) => {
|
||||
it(`should have valid path schematic: ${schematic}`, () => {
|
||||
validateMigration(m, root);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function validateMigration(m: MigrationsJsonEntry, root: string) {
|
||||
const impl = m.factory ?? m.implementation;
|
||||
const [implPath, implMember] = impl.includes('#')
|
||||
? impl.split('#')
|
||||
: [impl, null];
|
||||
let implModule;
|
||||
expect(() => {
|
||||
implModule = require(path.join(root, `${implPath}.ts`));
|
||||
}).not.toThrow();
|
||||
if (implMember) {
|
||||
expect(implModule).toHaveProperty(implMember);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import { FsTree, Tree } from '../src/generators/tree';
|
||||
import { join } from 'path';
|
||||
|
||||
export function assertRunsAgainstNxRepo(
|
||||
migrateFn: (tree: Tree) => void | Promise<void>
|
||||
) {
|
||||
it('should run against the Nx repo', async () => {
|
||||
const tree = new FsTree(join(__dirname, '../../../'), true);
|
||||
let resultOrPromise: void | Promise<void> = migrateFn(tree);
|
||||
|
||||
if (resultOrPromise && 'then' in resultOrPromise) {
|
||||
try {
|
||||
await resultOrPromise;
|
||||
} catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1,12 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
describe('Nx migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m) => {
|
||||
expect(() =>
|
||||
require.resolve(path.join(__dirname, `${m.implementation}.ts`))
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from './internal-testing-utils/assert-valid-migrations';
|
||||
import { MigrationsJson } from './src/config/misc-interfaces';
|
||||
|
||||
describe('nx migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -76,7 +76,7 @@ export interface MigrationsJsonEntry {
|
||||
|
||||
export interface MigrationsJson {
|
||||
name?: string;
|
||||
version: string;
|
||||
version?: string;
|
||||
collection?: string;
|
||||
generators?: { [name: string]: MigrationsJsonEntry };
|
||||
schematics?: { [name: string]: MigrationsJsonEntry };
|
||||
|
||||
@ -3,6 +3,7 @@ import { createTreeWithEmptyWorkspace } from '../../generators/testing-utils/cre
|
||||
import { addProjectConfiguration } from '../../generators/utils/project-configuration';
|
||||
import { readJson, updateJson, writeJson } from '../../generators/utils/json';
|
||||
import removeRoots from './remove-roots';
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
|
||||
describe('remove-roots >', () => {
|
||||
let tree: Tree;
|
||||
@ -46,4 +47,6 @@ describe('remove-roots >', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(removeRoots);
|
||||
});
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
import { createTreeWithEmptyWorkspace } from '../../generators/testing-utils/create-tree-with-empty-workspace';
|
||||
import type { Tree } from '../../generators/tree';
|
||||
import { readJson, writeJson } from '../../generators/utils/json';
|
||||
@ -58,4 +59,6 @@ describe('add-json-schema >', () => {
|
||||
readJson(tree, 'libs/nested/test-two/project.json')['$schema']
|
||||
).toEqual('../../../node_modules/nx/schemas/project-schema.json');
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(addJsonSchema);
|
||||
});
|
||||
|
||||
@ -4,6 +4,7 @@ import {
|
||||
readNxJson,
|
||||
updateNxJson,
|
||||
} from '../../generators/utils/project-configuration';
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
import removeDefaultCollection from './remove-default-collection';
|
||||
|
||||
describe('remove-default-collection', () => {
|
||||
@ -52,4 +53,6 @@ describe('remove-default-collection', () => {
|
||||
tree.delete('nx.json');
|
||||
await expect(removeDefaultCollection(tree)).resolves.not.toThrow();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(removeDefaultCollection);
|
||||
});
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
import { createTreeWithEmptyWorkspace } from '../../generators/testing-utils/create-tree-with-empty-workspace';
|
||||
import type { Tree } from '../../generators/tree';
|
||||
import {
|
||||
@ -40,4 +41,6 @@ describe('createTargetDefaults', () => {
|
||||
tree.delete('nx.json');
|
||||
await expect(createTargetDefaults(tree)).resolves.not.toThrow();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(createTargetDefaults);
|
||||
});
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
import { createTreeWithEmptyWorkspace } from '../../generators/testing-utils/create-tree-with-empty-workspace';
|
||||
import type { Tree } from '../../generators/tree';
|
||||
import {
|
||||
@ -451,4 +452,6 @@ describe('15.0.0 migration (migrate-to-inputs) (v1)', () => {
|
||||
const lib = readProjectConfiguration(tree, 'lib1');
|
||||
expect(lib.namedInputs).toBeUndefined();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(migrateToInputs);
|
||||
});
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
import update from './update-depends-on-to-tokens';
|
||||
import { updateJson, writeJson } from '../../generators/utils/json';
|
||||
import { createTreeWithEmptyWorkspace } from '../../generators/testing-utils/create-tree-with-empty-workspace';
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
|
||||
describe('update-depends-on-to-tokens', () => {
|
||||
it('should update nx.json', async () => {
|
||||
@ -125,4 +126,6 @@ describe('update-depends-on-to-tokens', () => {
|
||||
promise = update(tree);
|
||||
await expect(promise).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(update);
|
||||
});
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
addProjectConfiguration,
|
||||
readProjectConfiguration,
|
||||
} from '../../generators/utils/project-configuration';
|
||||
import { assertRunsAgainstNxRepo } from '../../../internal-testing-utils/run-migration-against-this-workspace';
|
||||
import removeRunCommandsOutputPath from './remove-run-commands-output-path';
|
||||
|
||||
describe('removeRunCommandsOutputPath', () => {
|
||||
@ -96,4 +97,6 @@ describe('removeRunCommandsOutputPath', () => {
|
||||
});
|
||||
expect(migratedTargetDefaults.other).toEqual(startingTargetDefaults.other);
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(removeRunCommandsOutputPath);
|
||||
});
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
"**/*.spec.ts",
|
||||
"**/*_spec.ts",
|
||||
"jest.config.ts",
|
||||
"**/__fixtures__/**/*.*"
|
||||
"**/__fixtures__/**/*.*",
|
||||
"internal-testing-utils/**/*.ts"
|
||||
],
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
"**/*.spec.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.d.ts",
|
||||
"internal-testing-utils/**/*.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { readJson, updateJson } from '@nx/devkit';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import { Linter } from '@nx/linter';
|
||||
import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils';
|
||||
import { ExecutorConfig } from 'nx/src/config/misc-interfaces';
|
||||
import executorGenerator from '../../generators/executor/executor';
|
||||
import pluginGenerator from '../../generators/plugin/plugin';
|
||||
@ -50,6 +51,8 @@ describe('update-15-0-0-specify-output-capture', () => {
|
||||
readJson<ExecutorConfig['schema']>(tree, schemaPath).outputCapture
|
||||
).toEqual('direct-nodejs');
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(update);
|
||||
});
|
||||
|
||||
async function createTreeWithBoilerplate() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Tree, readJson, updateJson } from '@nx/devkit';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils';
|
||||
import replacePackage from './update-16-0-0-add-nx-packages';
|
||||
|
||||
describe('update-16-0-0-add-nx-packages', () => {
|
||||
@ -34,4 +35,6 @@ describe('update-16-0-0-add-nx-packages', () => {
|
||||
|
||||
expect(newDependencyVersion).toBeDefined();
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(replacePackage);
|
||||
});
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
} from '@nx/devkit';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import { Linter } from '@nx/linter';
|
||||
import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils';
|
||||
import { PackageJson } from 'nx/src/utils/package-json';
|
||||
import executorGenerator from '../../generators/executor/executor';
|
||||
import generatorGenerator from '../../generators/generator/generator';
|
||||
@ -234,6 +235,8 @@ describe('updateCliPropsForPlugins', () => {
|
||||
const updated = readJson(tree, schemaPath);
|
||||
expect(updated).not.toHaveProperty('cli');
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(updateCliPropsForPlugins);
|
||||
});
|
||||
|
||||
async function createPlugin(tree: Tree) {
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
addProjectConfiguration,
|
||||
readProjectConfiguration,
|
||||
} from '@nx/devkit';
|
||||
import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import replaceE2EExecutor from './replace-e2e-executor';
|
||||
|
||||
@ -65,4 +66,6 @@ describe('update-16-0-0-add-nx-packages', () => {
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
assertRunsAgainstNxRepo(replaceE2EExecutor);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('React Native migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('react-native migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('React migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('react migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Rollup migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('rollup migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Storybook migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('storybook migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Vite migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('vite migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Web migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('web migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,15 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
import { MigrationsJsonEntry } from 'nx/src/config/misc-interfaces';
|
||||
|
||||
describe('Webpack migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: MigrationsJsonEntry) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.factory ?? m.implementation}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('webpack migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
import path = require('path');
|
||||
import json = require('./migrations.json');
|
||||
|
||||
describe('Workspace migrations', () => {
|
||||
it('should have valid paths', () => {
|
||||
Object.values(json.generators).forEach((m: any) => {
|
||||
expect(() =>
|
||||
require.resolve(
|
||||
path.join(__dirname, `${m.implementation || m.factory}.ts`)
|
||||
)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils';
|
||||
import { MigrationsJson } from '@nx/devkit';
|
||||
|
||||
describe('workspace migrations', () => {
|
||||
assertValidMigrationPaths(json as MigrationsJson, __dirname);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user