--- lang: ja-jp breaks: true --- # TypeScript NestJS NestExpressApplication で Hello World 2021-05-17 ```shell= $ sudo npm install -g @nestjs/cli ``` ## プロジェクトの作成 ```shell= nest new [project-name] ``` ## 実行 ```shell= npm start ``` または、 ```shell= yarn start ``` ## 確認 http://localhost:3000/  ## テストの実行 ```shell= npm test ``` または、 ```shell= yarn test ``` ## テストに失敗した場合 ```shell= $ npm test > nestjs-001@0.0.1 test > jest FAIL src/app.controller.spec.ts AppController root ✕ should return "Hello World!" (13 ms) ● AppController › root › should return "Hello World!" expect(received).toBe(expected) // Object.is equality Expected: "こんにちは世界??" Received: "こんにちは世界!!" 17 | describe('root', () => { 18 | it('should return "Hello World!"', () => { > 19 | expect(appController.getHello()).toBe('こんにちは世界??'); | ^ 20 | }); 21 | }); 22 | }); at Object.<anonymous> (app.controller.spec.ts:19:40) Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 2.454 s Ran all test suites. ``` ###### tags: `TypeScript` `NestJS` `NestExpressApplication` `Hello World`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up