-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: move consts project configuration to fixtures
- Loading branch information
1 parent
2e749e3
commit a78f6c4
Showing
3 changed files
with
63 additions
and
64 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
projects/nx-verdaccio/src/fixtures/project-configuration.fixture.ts
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import type { ProjectConfiguration } from '@nx/devkit'; | ||
|
||
const MOCK_PROJECT_CONFIGURATION: ProjectConfiguration = { | ||
name: 'mock-project', | ||
root: 'apps/mock-project', | ||
sourceRoot: 'apps/mock-project/src', | ||
projectType: 'application', | ||
tags: ['e2e', 'unit-test'], | ||
implicitDependencies: ['shared-library'], | ||
targets: { | ||
build: { | ||
executor: '@nx/web:build', | ||
options: { | ||
outputPath: 'dist/apps/mock-project', | ||
index: 'apps/mock-project/src/index.html', | ||
main: 'apps/mock-project/src/main.ts', | ||
tsConfig: 'apps/mock-project/tsconfig.app.json', | ||
}, | ||
configurations: { | ||
production: { | ||
fileReplacements: [ | ||
{ | ||
replace: 'apps/mock-project/src/environments/environment.ts', | ||
with: 'apps/mock-project/src/environments/environment.prod.ts', | ||
}, | ||
], | ||
optimization: true, | ||
sourceMap: false, | ||
}, | ||
}, | ||
}, | ||
}, | ||
generators: { | ||
'@nx/react': { | ||
library: { | ||
style: 'scss', | ||
}, | ||
}, | ||
}, | ||
namedInputs: { | ||
default: ['{projectRoot}/**/*', '!{projectRoot}/**/*.spec.ts'], | ||
production: ['default', '!{projectRoot}/**/*.test.ts'], | ||
}, | ||
release: { | ||
version: { | ||
generator: '@nx/version', | ||
generatorOptions: { | ||
increment: 'minor', | ||
}, | ||
}, | ||
}, | ||
metadata: { | ||
description: 'This is a mock project for testing.', | ||
}, | ||
}; | ||
|
||
export const MOCK_TARGETS_CACHE: Record< | ||
string, | ||
Partial<ProjectConfiguration> | ||
> = { | ||
mockKey: MOCK_PROJECT_CONFIGURATION, | ||
}; |
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 |
---|---|---|
@@ -1,64 +1 @@ | ||
import type { ProjectConfiguration } from '@nx/devkit'; | ||
|
||
export const MEMFS_VOLUME = '/test'; | ||
|
||
const MOCK_PROJECT_CONFIGURATION: ProjectConfiguration = { | ||
name: 'mock-project', | ||
root: 'apps/mock-project', | ||
sourceRoot: 'apps/mock-project/src', | ||
projectType: 'application', | ||
tags: ['e2e', 'unit-test'], | ||
implicitDependencies: ['shared-library'], | ||
targets: { | ||
build: { | ||
executor: '@nx/web:build', | ||
options: { | ||
outputPath: 'dist/apps/mock-project', | ||
index: 'apps/mock-project/src/index.html', | ||
main: 'apps/mock-project/src/main.ts', | ||
tsConfig: 'apps/mock-project/tsconfig.app.json', | ||
}, | ||
configurations: { | ||
production: { | ||
fileReplacements: [ | ||
{ | ||
replace: 'apps/mock-project/src/environments/environment.ts', | ||
with: 'apps/mock-project/src/environments/environment.prod.ts', | ||
}, | ||
], | ||
optimization: true, | ||
sourceMap: false, | ||
}, | ||
}, | ||
}, | ||
}, | ||
generators: { | ||
'@nx/react': { | ||
library: { | ||
style: 'scss', | ||
}, | ||
}, | ||
}, | ||
namedInputs: { | ||
default: ['{projectRoot}/**/*', '!{projectRoot}/**/*.spec.ts'], | ||
production: ['default', '!{projectRoot}/**/*.test.ts'], | ||
}, | ||
release: { | ||
version: { | ||
generator: '@nx/version', | ||
generatorOptions: { | ||
increment: 'minor', | ||
}, | ||
}, | ||
}, | ||
metadata: { | ||
description: 'This is a mock project for testing.', | ||
}, | ||
}; | ||
|
||
export const MOCK_TARGETS_CACHE: Record< | ||
string, | ||
Partial<ProjectConfiguration> | ||
> = { | ||
mockKey: MOCK_PROJECT_CONFIGURATION, | ||
}; |