Skip to content

Commit

Permalink
chore()repo): fixes to allow the e2e tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
srleecode committed Nov 28, 2021
1 parent 3a9e47d commit df6409a
Show file tree
Hide file tree
Showing 13 changed files with 20,747 additions and 10,142 deletions.
4 changes: 3 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"extends": ["@commitlint/config-angular"],
"rules": {}
"rules": {
"type-enum": [2, "always", ["feat", "fix", "cleanup", "docs", "chore"]]
}
}
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ git fetch origin --prune && git tag -l | xargs git tag -d && git fetch -t
npx sort-package-json

# after merging code, new package.json dependencies might be introduced
yarn install
npm install
60 changes: 56 additions & 4 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,60 @@ You can file new issues by filling out our [issue form](https://github.com/srlee

### <a name="submit-pr"></a> Submitting a PR

Please follow the following guidelines:
```sh
npm install

- Make sure unit tests pass (`npm run affected:test`)
- Make sure lint passes (`npm run affected:lint`)
- Make sure the e2e tests pass (`npm run affected:e2e`)
# Make sure that the below are passing
npm run affected:test
npm run affected:lint
npm run e2e
```

#### Commit Message Guidelines

The commit message should follow the following format:

```
type(scope): subject
BLANK LINE
body
```

##### Type

The type must be one of the following:

- feat - New or improved behavior being introduced (e.g. Updating to new versions of React or Jest which bring in new features)
- fix - Fixes the current unexpected behavior to match expected behavior (e.g. Fixing the library generator to create the proper named project)
- cleanup - Code Style changes that have little to no effect on the user (e.g. Refactoring some functions into a different file)
- docs - Changes to the documentation (e.g. Adding more details into the getting started guide)
- chore - Changes that have absolutely no effect on users (e.g. Updating the version of Nx used to build the repo)

##### Scope

The scope must be one of the following:

- cypress - anything related to the cypress generators
- front-end - anything related to the front-end generators
- grouping-folder - anything related to the grouping-folder generators
- init - anything related to the init generators
- mock-file - anything related to the mock-file generators
- shared - anything related to the utlities used across all the types of generators
- repo - anything related to managing the repo itself
- misc - misc stuff

##### Subject and Body

The subject must contain a description of the change, and the body of the message contains any additional details to provide more context about the change.

Including the issue number that the PR relates to also helps with tracking.

#### Example

```
feat(front-end): add an option to generate lazy-loadable modules
Updates the generateed libraries to allow the option to include --lazy `nx generate lib mylib --lazy`
Closes #157
```
5 changes: 2 additions & 3 deletions e2e/domain/cypress/domain-test/src/domain-test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
checkFilesExist,
newNxProject,
ensureNxProject,
runNxCommandAsync,
} from '@nrwl/nx-plugin/testing';

describe('domainTest e2e', () => {
const groupingFolder = 'libs/ng-test-app/test-domain';
beforeAll(async () => {
newNxProject('@srleecode/domain', 'dist/packages/domain');
ensureNxProject('@srleecode/domain', 'dist/packages/domain');
await runNxCommandAsync(`generate @srleecode/domain:ng-add`);
await runNxCommandAsync(
`generate @srleecode/domain:appGroupingFolder --name test-app --applicationType ng`
Expand All @@ -16,7 +16,6 @@ describe('domainTest e2e', () => {
`generate @srleecode/domain:domainGroupingFolder --name test-domain --groupingFolder libs/ng-test-app`
);
});

it('should create e2e project for domain', async () => {
await runNxCommandAsync(
`generate @srleecode/domain:domainTest --groupingFolder ${groupingFolder}`
Expand Down
4 changes: 2 additions & 2 deletions e2e/domain/front-end/angular/src/application-layer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
checkFilesExist,
newNxProject,
ensureNxProject,
runNxCommandAsync,
} from '@nrwl/nx-plugin/testing';

describe('application-layer', () => {
const groupingFolder = 'libs/ng-test-app/test-domain';
beforeAll(async () => {
newNxProject('@srleecode/domain', 'dist/packages/domain');
ensureNxProject('@srleecode/domain', 'dist/packages/domain');
await runNxCommandAsync(`generate @srleecode/domain:ng-add`);
await runNxCommandAsync(
`generate @srleecode/domain:appGroupingFolder --name test-app --applicationType ng`
Expand Down
4 changes: 2 additions & 2 deletions e2e/domain/grouping-folder/src/app-grouping-folder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
checkFilesExist,
newNxProject,
ensureNxProject,
runNxCommandAsync,
updateFile,
} from '@nrwl/nx-plugin/testing';
import { EMPTY_ESLINT } from './model/empty-eslint.const';

describe('app grouping folder', () => {
beforeAll(async () => {
newNxProject('@srleecode/domain', 'dist/packages/domain');
ensureNxProject('@srleecode/domain', 'dist/packages/domain');
updateFile('.eslintrc.json', JSON.stringify(EMPTY_ESLINT));
await runNxCommandAsync(`generate @srleecode/domain:ng-add`);
});
Expand Down
1 change: 1 addition & 0 deletions e2e/domain/grouping-folder/src/remove.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('remove', () => {
`generate @srleecode/domain:removeGroupingFolder --groupingFolder ${groupingFolder}`
);
});

it('should remove domain grouping folder', async () => {
expect(fileExists(`${groupingFolder}/util/src/index.ts`)).toBe(false);
});
Expand Down
4 changes: 2 additions & 2 deletions e2e/domain/mock-file/src/mock-file.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
checkFilesExist,
newNxProject,
ensureNxProject,
runNxCommandAsync,
} from '@nrwl/nx-plugin/testing';

describe('mockFile e2e', () => {
const groupingFolder = 'libs/ng-test-app/test-domain';
beforeAll(async () => {
newNxProject('@srleecode/domain', 'dist/packages/domain');
ensureNxProject('@srleecode/domain', 'dist/packages/domain');
await runNxCommandAsync(`generate @srleecode/domain:ng-add`);
await runNxCommandAsync(
`generate @srleecode/domain:appGroupingFolder --name test-app --applicationType ng`
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"options": {
"parallel": 3,
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "Y2NhMWI0ZDYtM2IxYS00MzZlLThiNzctNTYwOGRhMjM2YTgwfHJlYWQtd3JpdGU="
"accessToken": "MmVmMjg2YWItOGRhNi00ZTljLTk2ZjQtMzUyOGNjOTIzZDE5fHJlYWQtd3JpdGU="
}
}
},
Expand Down
Loading

0 comments on commit df6409a

Please sign in to comment.