Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
collettemathieu committed Jul 16, 2024
1 parent e4c1f2a commit 1662aa7
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 26 deletions.
2 changes: 2 additions & 0 deletions apps/pathway-design/server/src/app/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Controller, Get, Inject } from '@nestjs/common';

import { PathwayDesignCreationServerBusinessEntitiesPathway } from '@bewoak/pathway-design-creation-server-business-entities-pathway';
import { AppService } from './app.service';

@Controller()
Expand All @@ -8,6 +9,7 @@ export class AppController {

@Get()
getData() {
new PathwayDesignCreationServerBusinessEntitiesPathway('name');
return this.appService.getData();
}
}
3 changes: 1 addition & 2 deletions apps/pathway-design/server/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"noImplicitAny": true,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"composite": true
"noFallthroughCasesInSwitch": true
},
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.step.ts"],
"include": ["src/**/*.ts"]
Expand Down
4 changes: 3 additions & 1 deletion apps/pathway-design/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"esModuleInterop": true,
"declaration": true
}
}
6 changes: 4 additions & 2 deletions apps/pathway-design/server/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"esModuleInterop": true
}
"esModuleInterop": true,
"composite": true
},
"include": ["src/**/*.ts"]
}
2 changes: 1 addition & 1 deletion docs/nx/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bun run nx generate @nx/js:lib --name=init-pathway --bundler=swc --directory=lib
### Create a Nx:Nest:Library

```bash
bun run nx generate @nx/nest:lib --name=pathway --buildable --publishable --directory=libs/pathway-design/creation/server/business/entities --importPath=@bewoak/pathway-design-creation-server-business-entities-pathway --linter=none --strict --tags=type:business:pathway-design:server --unitTestRunner=none --projectNameAndRootFormat=derived --standaloneConfig
bun run nx generate @nx/nest:lib --name=pathway --buildable --publishable --directory=libs/pathway-design/creation/server/business/entities --importPath=@bewoak/pathway-design-creation-server-business-entities-pathway --linter=none --strict --tags=type:business:pathway-design:server --unitTestRunner=none --projectNameAndRootFormat=derived --standaloneConfig -d
```

### Convert a Nx:Library to swc compiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@
"type": "commonjs"
},
"sourceMaps": true,
"exclude": [
"jest.config.ts",
".*\\.spec.tsx?$",
".*\\.test.tsx?$",
"./src/jest-setup.ts$",
"./**/jest-setup.ts$",
".*.js$"
]
"exclude": [".*\\.spec.tsx?$", ".*\\.test.tsx?$", ".*.js$"]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../../../../../tsconfig.base.json",
"compilerOptions": {
"module": "esnext",
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"noImplicitAny": true,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"composite": true
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.step.ts"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"type": "commonjs"
},
"sourceMaps": true,
"exclude": [".*\\.spec.tsx?$", ".*\\.test.tsx?$", ".*.js$"]
"exclude": [".*\\.spec.tsx?$", ".*\\.step.ts$", ".*\\.test.tsx?$", ".*.js$"]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Feature: Initiate Pathway

Scenario: I want to initiate a pathway
Given I am an author
When I initiate a pathway with the name "My Pathway"
Then I should retrieve a pathway initiated with the name "My Pathway"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert';
import type { PathwayDesignCreationServerBusinessEntitiesPathway } from '@bewoak/pathway-design-creation-server-business-entities-pathway';
import { binding, given, then, when } from 'cucumber-tsflow';
import { binding, then, when } from 'cucumber-tsflow';
import { strict as assert } from 'node:assert';
import { PathwayDesignCreationServerBusinessUsecasesInitPathway } from './index.usecase';

@binding()
Expand All @@ -11,9 +11,6 @@ class ControllerSteps {
| PathwayDesignCreationServerBusinessEntitiesPathway
| undefined;

@given('I am an author')
public givenIAmAnAuthor() {}

@when('I initiate a pathway with the name {string}')
public whenIInitiateAPathway(name: string) {
this.pathway = this.initPathwayUsecase?.execute({ name });
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2020",
"target": "es2015",
"module": "esnext",
"lib": ["es2020", "dom"],
"skipLibCheck": true,
Expand Down

0 comments on commit 1662aa7

Please sign in to comment.