-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(it-tests): test schematics with yarn 1
- Loading branch information
1 parent
69c9ca3
commit 5800def
Showing
10 changed files
with
151 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,14 @@ | |
* @jest-environment @o3r/test-helpers/jest-environment | ||
* @jest-environment-o3r-app-folder test-create-app | ||
* @jest-environment-o3r-type blank | ||
* @jest-environment-o3r-package-scope o3r-create | ||
*/ | ||
const o3rEnvironment = globalThis.o3rEnvironment; | ||
|
||
import { | ||
getDefaultExecSyncOptions, | ||
getPackageManager, | ||
isYarn1Enforced, | ||
packageManagerCreate, | ||
packageManagerExec, | ||
packageManagerInstall, | ||
|
@@ -23,7 +25,7 @@ const workspaceProjectName = 'my-project'; | |
|
||
describe('Create new otter project command', () => { | ||
test('should generate a project with an application', async () => { | ||
const { workspacePath, packageManagerConfig, o3rVersion } = o3rEnvironment.testEnvironment; | ||
const { workspacePath, packageManagerConfig } = o3rEnvironment.testEnvironment; | ||
const inAppPath = path.join(workspacePath, workspaceProjectName); | ||
const execWorkspaceOptions = {...defaultExecOptions, cwd: workspacePath }; | ||
const execInAppOptions = {...defaultExecOptions, cwd: inAppPath }; | ||
|
@@ -33,7 +35,7 @@ describe('Create new otter project command', () => { | |
await fs.mkdir(inAppPath, { recursive: true }); | ||
setPackagerManagerConfig(packageManagerConfig, execInAppOptions); | ||
|
||
expect(() => packageManagerCreate({ script: `@o3r@${o3rVersion}`, args: [workspaceProjectName, ...createOptions] }, execWorkspaceOptions, 'npm')).not.toThrow(); | ||
expect(() => packageManagerCreate({ script: `@o3r`, args: [workspaceProjectName, ...createOptions] }, execWorkspaceOptions, !isYarn1Enforced() ? 'npm' : undefined)).not.toThrow(); | ||
Check failure on line 38 in packages/@o3r/create/src/index.it.spec.ts GitHub Actions / it-tests / it-tests (ubuntu-latest, yarn1, o3r-project-with-app)Create new otter project command › should generate a project with an application
|
||
expect(existsSync(path.join(inAppPath, 'angular.json'))).toBe(true); | ||
expect(existsSync(path.join(inAppPath, 'package.json'))).toBe(true); | ||
expect(() => packageManagerInstall(execInAppOptions)).not.toThrow(); | ||
|
@@ -57,7 +59,7 @@ describe('Create new otter project command', () => { | |
await fs.mkdir(inAppPath, { recursive: true }); | ||
setPackagerManagerConfig(packageManagerConfig, execInAppOptions); | ||
|
||
expect(() => packageManagerCreate({ script: `@o3r@${o3rVersion}`, args: [workspaceProjectName, ...createOptions] }, execWorkspaceOptions, 'npm')).not.toThrow(); | ||
expect(() => packageManagerCreate({ script: `@o3r`, args: [workspaceProjectName, ...createOptions] }, execWorkspaceOptions, !isYarn1Enforced() ? 'npm' : undefined)).not.toThrow(); | ||
Check failure on line 62 in packages/@o3r/create/src/index.it.spec.ts GitHub Actions / it-tests / it-tests (ubuntu-latest, yarn1, o3r-project-with-app)Create new otter project command › should generate a project with an application with --exact-o3r-version
|
||
expect(existsSync(path.join(inAppPath, 'angular.json'))).toBe(true); | ||
expect(existsSync(path.join(inAppPath, 'package.json'))).toBe(true); | ||
expect(() => packageManagerInstall(execInAppOptions)).not.toThrow(); | ||
|
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
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
Oops, something went wrong.