Skip to content

Commit

Permalink
chore: edit scripts and husky
Browse files Browse the repository at this point in the history
  • Loading branch information
rudemex committed May 2, 2023
1 parent 2550bbc commit e68ebac
Show file tree
Hide file tree
Showing 20 changed files with 1,280 additions and 1,293 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn test
yarn test:husky
yarn lint
yarn format
git add .
2 changes: 1 addition & 1 deletion mochawesome-report/index.html

Large diffs are not rendered by default.

1,220 changes: 610 additions & 610 deletions mochawesome.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"prebuild": "rimraf ./dist",
"build": "turbo run build --concurrency=1",
"test": "turbo run test --concurrency=1",
"test:husky": "turbo run test --concurrency=1",
"posttest": "yarn report",
"clean": "turbo run clean",
"postclean": "rimraf ./yarn.lock ./package-lock.json ./dist ./mochawesome-report ./mochawesome.json ./node_modules",
Expand All @@ -33,11 +34,12 @@
"bs": "lerna bootstrap",
"hoist-deps": "lerna clean -y && lerna bootstrap",
"plop": "plop",
"pretest": "rimraf ./packages/*/test-results",
"prereport": "rimraf ./mochawesome-report ./mochawesome.json",
"report": "yarn mochawesome:merge",
"postreport": "yarn mochawesome:report-generator",
"mochawesome:merge": "npx mochawesome-merge -f ./packages/*/test-results/*.json > mochawesome.json",
"mochawesome:report-generator": "npx marge -f index --charts --assetsDir ./mochawesome-report/assets mochawesome.json"
"mochawesome:report-generator": "npx marge -f index -t \"Tresdoce NestJS Toolkit\" -p \"Tresdoce NestJS Toolkit - Test Reports\" --overwrite --charts --assetsDir ./mochawesome-report/assets mochawesome.json"
},
"workspaces": [
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/archetype/src/__test__/constants.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RequestMethod } from '@nestjs/common';
import { manifestControllerExcludes } from '../archetype/constants/archetype.constants';

describe('healthConstants', () => {
describe('Constants', () => {
it('should be return exclude to prefix global', async () => {
expect(manifestControllerExcludes).toEqual(expect.any(Array));
expect(manifestControllerExcludes).toMatchObject([
Expand Down
78 changes: 39 additions & 39 deletions packages/archetype/test-results/test-report.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions packages/camunda/test-results/test-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"hasOther": false,
"skipped": 0,
"hasSkipped": false,
"start": "2023-05-02T00:49:18.085Z",
"end": "2023-05-02T00:49:18.305Z",
"duration": 220
"start": "2023-05-02T02:24:03.238Z",
"end": "2023-05-02T02:24:03.457Z",
"duration": 219
},
"results": [
{
"uuid": "adcd52cc-8b72-4468-89a5-bee1ff93ca02",
"uuid": "954518e6-40ae-4f00-9065-09f41e097e6a",
"title": "@tresdoce-nestjs-toolkit/camunda",
"fullFile": "",
"file": "",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "809e24eb-b710-4ac6-94bc-020031b8b792",
"uuid": "98f30cff-f489-4c70-af61-9f09f8d7ea74",
"title": "@tresdoce-nestjs-toolkit/camunda",
"fullFile": "",
"file": "",
Expand All @@ -38,7 +38,7 @@
"title": "CamundaModule > should be defined",
"fullTitle": "should be defined",
"timedOut": false,
"duration": 211,
"duration": 210,
"state": "passed",
"speed": null,
"pass": true,
Expand All @@ -47,8 +47,8 @@
"context": null,
"code": "import { Test, TestingModule } from '@nestjs/testing';\nimport { INestApplication } from '@nestjs/common';\nimport { ConfigModule } from '@nestjs/config';\nimport { CamundaModule } from '../camunda/camunda.module';\nimport { dynamicConfig, tcName, testContainers } from '@tresdoce-nestjs-toolkit/test-utils';\nimport { Subscription } from '../camunda/decorators/camunda.decorator';\nimport { CamundaTaskConnector } from '../camunda/providers/camunda.provider';\n\ndescribe('CamundaModule', () => {\n let app: INestApplication;\n let container: testContainers;\n\n beforeAll(async () => {\n container = await new testContainers('camunda/camunda-bpm-platform:7.17.0', {\n ports: [\n {\n container: 8080,\n host: 8080,\n },\n ],\n containerName: `${tcName}-camunda-bpm`,\n reuse: true,\n });\n await container.start();\n });\n\n afterAll(async () => {\n await container.stop({ removeVolumes: true });\n });\n\n beforeEach(async () => {\n const moduleFixture: TestingModule = await Test.createTestingModule({\n imports: [\n ConfigModule.forRoot({\n isGlobal: true,\n load: [\n dynamicConfig({\n camunda: {\n baseUrl: 'http://localhost:8080/engine-rest',\n },\n }),\n ],\n }),\n CamundaModule,\n ],\n }).compile();\n\n app = moduleFixture.createNestApplication();\n app.connectMicroservice({\n strategy: app.get(CamundaTaskConnector),\n });\n await app.startAllMicroservices();\n await app.init();\n });\n\n it('should be defined', () => {\n expect(app).toBeDefined();\n });\n\n it('should be Subscription decorator is defined with options', async () => {\n const decorator = Subscription('test-topic', { lockDuration: 500 });\n console.log(decorator);\n expect(decorator).toBeDefined();\n });\n});\n",
"err": {},
"uuid": "ac026077-3923-447e-a382-ddf89ee64d9d",
"parentUUID": "809e24eb-b710-4ac6-94bc-020031b8b792",
"uuid": "9f35a279-18cc-415c-b8f9-b5538d06a583",
"parentUUID": "98f30cff-f489-4c70-af61-9f09f8d7ea74",
"isHook": false,
"skipped": false
},
Expand All @@ -65,21 +65,21 @@
"context": null,
"code": "import { Test, TestingModule } from '@nestjs/testing';\nimport { INestApplication } from '@nestjs/common';\nimport { ConfigModule } from '@nestjs/config';\nimport { CamundaModule } from '../camunda/camunda.module';\nimport { dynamicConfig, tcName, testContainers } from '@tresdoce-nestjs-toolkit/test-utils';\nimport { Subscription } from '../camunda/decorators/camunda.decorator';\nimport { CamundaTaskConnector } from '../camunda/providers/camunda.provider';\n\ndescribe('CamundaModule', () => {\n let app: INestApplication;\n let container: testContainers;\n\n beforeAll(async () => {\n container = await new testContainers('camunda/camunda-bpm-platform:7.17.0', {\n ports: [\n {\n container: 8080,\n host: 8080,\n },\n ],\n containerName: `${tcName}-camunda-bpm`,\n reuse: true,\n });\n await container.start();\n });\n\n afterAll(async () => {\n await container.stop({ removeVolumes: true });\n });\n\n beforeEach(async () => {\n const moduleFixture: TestingModule = await Test.createTestingModule({\n imports: [\n ConfigModule.forRoot({\n isGlobal: true,\n load: [\n dynamicConfig({\n camunda: {\n baseUrl: 'http://localhost:8080/engine-rest',\n },\n }),\n ],\n }),\n CamundaModule,\n ],\n }).compile();\n\n app = moduleFixture.createNestApplication();\n app.connectMicroservice({\n strategy: app.get(CamundaTaskConnector),\n });\n await app.startAllMicroservices();\n await app.init();\n });\n\n it('should be defined', () => {\n expect(app).toBeDefined();\n });\n\n it('should be Subscription decorator is defined with options', async () => {\n const decorator = Subscription('test-topic', { lockDuration: 500 });\n console.log(decorator);\n expect(decorator).toBeDefined();\n });\n});\n",
"err": {},
"uuid": "4bd7c4db-5e44-4f87-b53a-41c1425082a5",
"parentUUID": "809e24eb-b710-4ac6-94bc-020031b8b792",
"uuid": "dcd0e652-46dc-4c73-9ae0-6a48f2251e77",
"parentUUID": "98f30cff-f489-4c70-af61-9f09f8d7ea74",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"ac026077-3923-447e-a382-ddf89ee64d9d",
"4bd7c4db-5e44-4f87-b53a-41c1425082a5"
"9f35a279-18cc-415c-b8f9-b5538d06a583",
"dcd0e652-46dc-4c73-9ae0-6a48f2251e77"
],
"failures": [],
"pending": [],
"skipped": [],
"duration": 220,
"duration": 219,
"root": false,
"rootEmpty": false,
"_timeout": 5000
Expand Down
40 changes: 20 additions & 20 deletions packages/commons/test-results/test-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"hasOther": false,
"skipped": 0,
"hasSkipped": false,
"start": "2023-05-02T00:49:15.758Z",
"end": "2023-05-02T00:49:15.766Z",
"start": "2023-05-02T02:24:16.578Z",
"end": "2023-05-02T02:24:16.586Z",
"duration": 8
},
"results": [
{
"uuid": "85f84663-7e2b-41c7-983c-cd11bf789127",
"uuid": "ac9c14c0-c26c-4930-bfe6-fd763e9aa0c0",
"title": "@tresdoce-nestjs-toolkit/commons",
"fullFile": "",
"file": "",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "8215a552-4805-4d0e-9a0e-1b6907f799bd",
"uuid": "6e523902-ed0f-457f-b070-7d60305b3647",
"title": "@tresdoce-nestjs-toolkit/commons",
"fullFile": "",
"file": "",
Expand All @@ -47,8 +47,8 @@
"context": null,
"code": "import { buildConfig } from '../index';\ndescribe('build-config', () => {\n const INIT_ENVS = process.env;\n\n beforeEach(() => {\n jest.resetModules();\n process.env = { ...INIT_ENVS };\n });\n\n afterAll(() => {\n process.env = INIT_ENVS;\n });\n\n it('should be return jest config is build', () => {\n process.env.NODE_ENV = 'build';\n const config = buildConfig({ output: {}, optimization: {} });\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n expect(config.mode).toEqual('production');\n });\n\n it('should be return jest config not is build', () => {\n process.env.NODE_ENV = 'dev';\n const config = buildConfig({ output: {}, optimization: {} });\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n expect(config.mode).toEqual('none');\n });\n});\n",
"err": {},
"uuid": "d98aa236-10f1-4685-bf09-a761a9dfbe01",
"parentUUID": "8215a552-4805-4d0e-9a0e-1b6907f799bd",
"uuid": "aedac7c9-dda3-4c3d-bfba-2106a8078116",
"parentUUID": "6e523902-ed0f-457f-b070-7d60305b3647",
"isHook": false,
"skipped": false
},
Expand All @@ -65,13 +65,13 @@
"context": null,
"code": "import { buildConfig } from '../index';\ndescribe('build-config', () => {\n const INIT_ENVS = process.env;\n\n beforeEach(() => {\n jest.resetModules();\n process.env = { ...INIT_ENVS };\n });\n\n afterAll(() => {\n process.env = INIT_ENVS;\n });\n\n it('should be return jest config is build', () => {\n process.env.NODE_ENV = 'build';\n const config = buildConfig({ output: {}, optimization: {} });\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n expect(config.mode).toEqual('production');\n });\n\n it('should be return jest config not is build', () => {\n process.env.NODE_ENV = 'dev';\n const config = buildConfig({ output: {}, optimization: {} });\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n expect(config.mode).toEqual('none');\n });\n});\n",
"err": {},
"uuid": "cfb8069b-f9b1-4032-89b3-710382eb75ab",
"parentUUID": "8215a552-4805-4d0e-9a0e-1b6907f799bd",
"uuid": "d7b833cd-9548-43b7-a2d6-78f5f6686888",
"parentUUID": "6e523902-ed0f-457f-b070-7d60305b3647",
"isHook": false,
"skipped": false
},
{
"title": "testing-library > should be return jest config",
"title": "eslint-config > should be return jest config",
"fullTitle": "should be return jest config",
"timedOut": false,
"duration": 2,
Expand All @@ -81,15 +81,15 @@
"fail": false,
"pending": false,
"context": null,
"code": "import { jestConfig } from '../index';\n\ndescribe('testing-library', () => {\n it('should be return jest config', () => {\n const config = jestConfig();\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n });\n});\n",
"code": "import { eslintConfig } from '../index';\ndescribe('eslint-config', () => {\n it('should be return jest config', () => {\n const config = eslintConfig();\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n });\n});\n",
"err": {},
"uuid": "3a4e66c0-b61b-4a47-aeb6-560a0b38e0b7",
"parentUUID": "8215a552-4805-4d0e-9a0e-1b6907f799bd",
"uuid": "ceabcfea-220e-4f3e-900e-f04648d45422",
"parentUUID": "6e523902-ed0f-457f-b070-7d60305b3647",
"isHook": false,
"skipped": false
},
{
"title": "eslint-config > should be return jest config",
"title": "testing-library > should be return jest config",
"fullTitle": "should be return jest config",
"timedOut": false,
"duration": 2,
Expand All @@ -99,20 +99,20 @@
"fail": false,
"pending": false,
"context": null,
"code": "import { eslintConfig } from '../index';\ndescribe('eslint-config', () => {\n it('should be return jest config', () => {\n const config = eslintConfig();\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n });\n});\n",
"code": "import { jestConfig } from '../index';\n\ndescribe('testing-library', () => {\n it('should be return jest config', () => {\n const config = jestConfig();\n expect(config).not.toBe(null);\n expect(typeof config).toBe('object');\n expect(config).toBeDefined();\n });\n});\n",
"err": {},
"uuid": "9d85277d-649f-42a4-97f8-1b762153502b",
"parentUUID": "8215a552-4805-4d0e-9a0e-1b6907f799bd",
"uuid": "c92ec633-cb69-424a-afac-7e9c24d83401",
"parentUUID": "6e523902-ed0f-457f-b070-7d60305b3647",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"d98aa236-10f1-4685-bf09-a761a9dfbe01",
"cfb8069b-f9b1-4032-89b3-710382eb75ab",
"3a4e66c0-b61b-4a47-aeb6-560a0b38e0b7",
"9d85277d-649f-42a4-97f8-1b762153502b"
"aedac7c9-dda3-4c3d-bfba-2106a8078116",
"d7b833cd-9548-43b7-a2d6-78f5f6686888",
"ceabcfea-220e-4f3e-900e-f04648d45422",
"c92ec633-cb69-424a-afac-7e9c24d83401"
],
"failures": [],
"pending": [],
Expand Down
Loading

0 comments on commit e68ebac

Please sign in to comment.