Skip to content

Commit

Permalink
Merge pull request #1 from yasaichi-sandbox/deno-v1392
Browse files Browse the repository at this point in the history
Improve the way of testing with updates on Deno v1.39.2
  • Loading branch information
yasaichi authored Jan 10, 2024
2 parents 53943a3 + e3922c1 commit f9bc38c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 33 deletions.
13 changes: 0 additions & 13 deletions deno.json

This file was deleted.

19 changes: 19 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true
},
"fmt": {
"include": ["src/", "test/"],
"singleQuote": true
},
// NOTE: Don't use the standard library or any third party modules of Deno
// as possible because we'd like to keep the room to go back to Node.js
// at any time.
"imports": {
"testing/": "https://deno.land/std@0.211.0/testing/"
},
"lint": {
"include": ["src/", "apps/", "libs/", "test/"]
},
"unstable": ["byonm"]
}
4 changes: 2 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/app.controller.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import {
beforeEach,
describe,
it,
} from 'https://deno.land/std@0.210.0/testing/bdd.ts';
import assert from 'node:assert';
import { beforeEach, describe, it } from 'testing/bdd.ts';
import { AppController } from './app.controller.ts';
import { AppService } from './app.service.ts';

Expand Down
14 changes: 1 addition & 13 deletions test/app.e2e_test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import {
afterEach,
beforeEach,
describe,
it,
} from 'https://deno.land/std@0.210.0/testing/bdd.ts';
import { ClientRequest } from 'node:http';
import request from 'supertest';
import { afterEach, beforeEach, describe, it } from 'testing/bdd.ts';
import { AppModule } from '../src/app.module.ts';

// NOTE: Delete this patch when the following issue is resolved:
// https://github.com/denoland/deno/issues/18316
ClientRequest.prototype.setNoDelay = function (noDelay) {
this.socket?.setNoDelay?.(noDelay);
};

describe('AppController (e2e)', () => {
let app: INestApplication;

Expand Down

0 comments on commit f9bc38c

Please sign in to comment.