-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
36 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,25 +19,6 @@ describe('create-nx-workspace', () => { | |
|
||
afterEach(() => cleanupProject()); | ||
|
||
it('should create a workspace with a single angular app at the root with routing', () => { | ||
const wsName = uniq('angular'); | ||
|
||
runCreateWorkspace(wsName, { | ||
preset: 'angular-standalone', | ||
appName: wsName, | ||
style: 'css', | ||
packageManager, | ||
standaloneApi: false, | ||
routing: true, | ||
}); | ||
|
||
checkFilesExist('package.json'); | ||
checkFilesExist('src/app/app.routes.ts'); | ||
checkFilesDoNotExist('tsconfig.base.json'); | ||
checkFilesExist('project.json'); | ||
expectCodeIsFormatted(); | ||
}); | ||
|
||
it('should create a workspace with a single angular app at the root without routing', () => { | ||
const wsName = uniq('angular'); | ||
|
||
|
@@ -46,6 +27,7 @@ describe('create-nx-workspace', () => { | |
appName: wsName, | ||
style: 'css', | ||
packageManager, | ||
standaloneApi: false, | ||
routing: false, | ||
}); | ||
|
||
|
@@ -70,6 +52,7 @@ describe('create-nx-workspace', () => { | |
|
||
checkFilesExist('package.json'); | ||
checkFilesExist('project.json'); | ||
checkFilesExist('src/app/app.routes.ts'); | ||
checkFilesDoNotExist('src/app/app.module.ts'); | ||
expectCodeIsFormatted(); | ||
}); | ||
|
@@ -113,7 +96,7 @@ describe('create-nx-workspace', () => { | |
it('should be able to create an empty workspace built for apps', () => { | ||
const wsName = uniq('apps'); | ||
runCreateWorkspace(wsName, { | ||
preset: 'empty', | ||
preset: 'apps', | ||
packageManager, | ||
}); | ||
|
||
|
@@ -123,9 +106,6 @@ describe('create-nx-workspace', () => { | |
'apps/.gitkeep', | ||
'libs/.gitkeep' | ||
); | ||
const foreignLockFiles = Object.keys(packageManagerLockFile) | ||
.filter((pm) => pm !== packageManager) | ||
.map((pm) => packageManagerLockFile[pm]); | ||
|
||
expectNoAngularDevkit(); | ||
}); | ||
|
@@ -179,7 +159,7 @@ describe('create-nx-workspace', () => { | |
appName, | ||
packageManager, | ||
standaloneApi: false, | ||
routing: true, | ||
routing: false, | ||
}) | ||
).toThrow(); | ||
}); | ||
|
@@ -293,7 +273,7 @@ describe('create-nx-workspace', () => { | |
it('should be able to create a workspace with a custom base branch and HEAD', () => { | ||
const wsName = uniq('branch'); | ||
runCreateWorkspace(wsName, { | ||
preset: 'empty', | ||
preset: 'apps', | ||
base: 'main', | ||
packageManager, | ||
}); | ||
|
@@ -302,7 +282,7 @@ describe('create-nx-workspace', () => { | |
it('should be able to create a workspace with custom commit information', () => { | ||
const wsName = uniq('branch'); | ||
runCreateWorkspace(wsName, { | ||
preset: 'empty', | ||
preset: 'apps', | ||
extraArgs: | ||
'--commit.name="John Doe" --commit.email="[email protected]" --commit.message="Custom commit message!"', | ||
packageManager, | ||
|
@@ -322,51 +302,24 @@ describe('create-nx-workspace', () => { | |
|
||
it('should respect package manager preference', () => { | ||
const wsName = uniq('pm'); | ||
const appName = uniq('app'); | ||
|
||
process.env.YARN_REGISTRY = `http://localhost:4872`; | ||
process.env.SELECTED_PM = 'npm'; | ||
|
||
runCreateWorkspace(wsName, { | ||
preset: 'react-monorepo', | ||
style: 'css', | ||
appName, | ||
packageManager: 'npm', | ||
bundler: 'webpack', | ||
}); | ||
|
||
checkFilesDoNotExist('yarn.lock'); | ||
checkFilesExist('package-lock.json'); | ||
expectCodeIsFormatted(); | ||
process.env.SELECTED_PM = packageManager; | ||
}); | ||
|
||
it('should store package manager preference for angular', () => { | ||
const wsName = uniq('pm'); | ||
const appName = uniq('app'); | ||
|
||
process.env.YARN_REGISTRY = `http://localhost:4872`; | ||
process.env.SELECTED_PM = 'npm'; | ||
|
||
runCreateWorkspace(wsName, { | ||
preset: 'angular-monorepo', | ||
appName, | ||
style: 'css', | ||
preset: 'apps', | ||
packageManager: 'npm', | ||
routing: true, | ||
standaloneApi: false, | ||
}); | ||
|
||
checkFilesDoNotExist('yarn.lock'); | ||
checkFilesExist('package-lock.json'); | ||
expectCodeIsFormatted(); | ||
process.env.SELECTED_PM = packageManager; | ||
}); | ||
|
||
it('should return error when ci workflow is selected but no cloud is set up', () => { | ||
const wsName = uniq('github'); | ||
const create = runCreateWorkspace(wsName, { | ||
preset: 'npm', | ||
runCreateWorkspace(wsName, { | ||
preset: 'apps', | ||
packageManager, | ||
ci: 'circleci', | ||
}); | ||
|
@@ -378,7 +331,7 @@ describe('create-nx-workspace', () => { | |
function setupProject(envPm: 'npm' | 'yarn' | 'pnpm') { | ||
process.env.SELECTED_PM = envPm; | ||
runCreateWorkspace(uniq('pm'), { | ||
preset: 'empty', | ||
preset: 'apps', | ||
packageManager: envPm, | ||
useDetectedPm: true, | ||
}); | ||
|
@@ -425,7 +378,7 @@ describe('create-nx-workspace', () => { | |
|
||
describe('create-nx-workspace custom parent folder', () => { | ||
const tmpDir = `${e2eCwd}/${uniq('with space')}`; | ||
const wsName = uniq('empty'); | ||
const wsName = uniq('parent'); | ||
const packageManager = getSelectedPackageManager() || 'pnpm'; | ||
|
||
afterEach(() => cleanupProject({ cwd: `${tmpDir}/${wsName}` })); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters