Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to @typestrong/ts-mockito #49

Merged
merged 14 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand All @@ -11,7 +11,7 @@
},
"plugins": ["jest"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -28,15 +28,15 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"parserOptions": {
"project": "./tsconfig.*?.json"
},
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check-out repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false # needed for semantic-release, see https://github.com/semantic-release/git/issues/196#issuecomment-601310576

- name: Setup Node.js 16.x
uses: actions/setup-node@v1
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version-file: 'package.json'

- name: Install node dependences
run: npm ci
Expand All @@ -35,7 +34,7 @@ jobs:
run: npm test -- --codeCoverage --coverageReporters=json --coverageReporters=text --coverageReporters=text-summary --skip-nx-cache

- name: Test coverage unit tests
uses: codecov/codecov-action@v1.0.14
uses: codecov/codecov-action@v3
with:
name: ng-mockito (unit tests)
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -44,7 +43,7 @@ jobs:
fail_ci_if_error: false

- name: Test coverage integration tests
uses: codecov/codecov-action@v1.0.14
uses: codecov/codecov-action@v3
with:
name: ng-mockito (integration tests)
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -58,7 +57,7 @@ jobs:
- name: Release
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN_QUPAYA_BOT }}
GITHUB_TOKEN: ${{ secrets.QUPAYA_BOT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_QUPAYA_BOT }}
GIT_AUTHOR_NAME: qupaya-bot
GIT_AUTHOR_EMAIL: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ Thumbs.db

# we use npm
yarn.lock

.nx/cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

/dist
/coverage

/.nx/cache
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"recommendations": [
"nrwl.angular-console",
"angular.ng-template",
"ms-vscode.vscode-typescript-tslint-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
]
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [3.0.0-next.1](https://github.com/qupaya/ng-mockito/compare/v2.0.1...v3.0.0-next.1) (2023-02-08)


### Features

* **ng-mockito:** switch to @typestrong/ts-mockito ([cc2dbf4](https://github.com/qupaya/ng-mockito/commit/cc2dbf4c80107184ba17975a327344baf1da138c))


### BREAKING CHANGES

* **ng-mockito:** CHANGE, see #46

## [2.0.1](https://github.com/qupaya/ng-mockito/compare/v2.0.0...v2.0.1) (2022-05-11)


Expand Down
73 changes: 0 additions & 73 deletions angular.json

This file was deleted.

79 changes: 0 additions & 79 deletions decorate-angular-cli.js

This file was deleted.

4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

module.exports = { projects: getJestProjects() };
export default { projects: getJestProjects() };
15 changes: 15 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const nxPreset = require('@nx/jest/preset').default;

module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
3 changes: 0 additions & 3 deletions jest.preset.ts

This file was deleted.

4 changes: 2 additions & 2 deletions libs/ng-mockito/integration/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"parserOptions": {
Expand All @@ -32,7 +32,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
22 changes: 12 additions & 10 deletions libs/ng-mockito/integration/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
module.exports = {
/* eslint-disable */
export default {
displayName: 'ng-mockito-integration',

setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../../coverage/libs/ng-mockito/integration',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
preset: '../../../jest.preset.ts',
preset: '../../../jest.preset.js',
};
28 changes: 28 additions & 0 deletions libs/ng-mockito/integration/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ng-mockito-integration",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/ng-mockito/integration/src",
"prefix": "qp",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["libs/ng-mockito/integration/src/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/ng-mockito/integration/jest.config.ts"
},
"outputs": ["{workspaceRoot}/coverage/libs/ng-mockito/integration"]
}
},
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"tags": ["scope:ng-mockito"]
}
Loading
Loading