* feat(core): consolidate settings between workspace.json + nx.json workspace.json (and linked project.json files) now contain all project specific settings. nx.json now contains all settings that affect the whole workspace. * chore(core): fix angular unit tests w/ new config * chore(core): fix failing tests * chore(core): fix formatting * chore(core): fix more tests * chore(core): normalize-nx-json feedback * chore(core): Fix more unit tests * chore(core): fix remaining tests in workspace * chore(linter): fix remaining linter tests * chore(core): fix remaining spec + build issues * chore(core): formatting fixes * feat(core): migration script to move config options to new locations * chore(core): fix e2e tests * chore(core): run format * chore(react-native): fix failing tests Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * feat(core): move properties to new location during format step Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * feat(core): initial pass on ngcli-adapter for property consolidation Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * chore(misc): fix tests Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * docs(core): update docs with changes * chore(misc): fix tests * chore(core): code review changes updateWorkspaceJson -> updateWorkspace, no longer uses updater function Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * chore(core): fix bug in ngcli impl * fix(core): fix bug in ngcli-adapter Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * fix(core): fix ngcli-adapter Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * chore(core): fix workspace e2e * chore(core): fix nx-plugin e2e * fix(core): move defaultProject to nx.json * chore(core): fix broken workspace test * chore(core): formatting * chore(core): fix workspace format * chore(core): add nxJson to ExecutorContext Signed-off-by: AgentEnder <craigorycoppola@gmail.com> * chore(core): remove all references ot `NxProjectConfiguration` from our code * chore(core): Review Changes * fix(core): update new config locations v13 migration
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
import { NxJsonConfiguration, readJson, Tree } from '@nrwl/devkit';
|
|
|
|
import { gatsbyInitGenerator } from './init';
|
|
|
|
describe('init', () => {
|
|
let tree: Tree;
|
|
|
|
beforeEach(() => {
|
|
tree = createTreeWithEmptyWorkspace();
|
|
});
|
|
|
|
it('should add react dependencies', async () => {
|
|
await gatsbyInitGenerator(tree, {});
|
|
const packageJson = readJson(tree, 'package.json');
|
|
expect(packageJson.dependencies['@nrwl/gatsby']).toBeUndefined();
|
|
expect(packageJson.dependencies['@nrwl/react']).toBeUndefined();
|
|
expect(packageJson.dependencies['gatsby']).toBeDefined();
|
|
});
|
|
|
|
describe('defaultCollection', () => {
|
|
it('should be set if none was set before', async () => {
|
|
await gatsbyInitGenerator(tree, {});
|
|
const { cli } = readJson<NxJsonConfiguration>(tree, 'nx.json');
|
|
expect(cli.defaultCollection).toEqual('@nrwl/gatsby');
|
|
});
|
|
});
|
|
|
|
it('should not add jest config if unitTestRunner is none', async () => {
|
|
await gatsbyInitGenerator(tree, { unitTestRunner: 'none' });
|
|
expect(tree.exists('jest.config.js')).toEqual(false);
|
|
});
|
|
});
|