Skip to content

Commit

Permalink
Merge pull request #418 from jiho-kr/feature/node20
Browse files Browse the repository at this point in the history
feat: unit-test on node v20
  • Loading branch information
jiho-kr authored Jan 9, 2024
2 parents 9f51348 + 8149d8e commit 5779d62
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
3 changes: 3 additions & 0 deletions spec/pagination/pagination.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PaginationType } from '../../src';
import { BaseService } from '../base/base.service';
import { TestHelper } from '../test.helper';

const TEST_LISTEN_PORT = 3339;
describe('Pagination with interceptor', () => {
const defaultLimit = 20;
describe('with ReadMany Interceptor', () => {
Expand Down Expand Up @@ -37,6 +38,8 @@ describe('Pagination with interceptor', () => {
const service: BaseService = moduleFixture.get<BaseService>(BaseService);
await service.repository.save(Array.from({ length: 100 }, (_, index) => index).map((number) => ({ name: `name-${number}` })));
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);
});

afterAll(async () => {
Expand Down
3 changes: 3 additions & 0 deletions spec/pagination/pagination.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { PaginationType } from '../../src';
import { BaseService } from '../base/base.service';
import { TestHelper } from '../test.helper';

const TEST_LISTEN_PORT = 3339;
describe('Pagination', () => {
let app: INestApplication;
let service: BaseService;
Expand All @@ -30,6 +31,8 @@ describe('Pagination', () => {

service = moduleFixture.get<BaseService>(BaseService);
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);
});

beforeEach(async () => {
Expand Down
4 changes: 4 additions & 0 deletions spec/pgsql/pgsql.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class TestController implements CrudController<TestEntity> {
})
class TestModule {}

const TEST_LISTEN_PORT = 3339;

describe('Search complex conditions', () => {
let app: INestApplication;

Expand All @@ -65,6 +67,8 @@ describe('Search complex conditions', () => {
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);

await Promise.all(
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((no) =>
Expand Down
6 changes: 4 additions & 2 deletions spec/search/search-complex-condition.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable max-classes-per-file */
import { HttpStatus, INestApplication } from '@nestjs/common';
import { Controller, Injectable, Module } from '@nestjs/common';
import { Controller, Injectable, Module, HttpStatus, INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { InjectRepository, TypeOrmModule } from '@nestjs/typeorm';
import { IsOptional } from 'class-validator';
Expand Down Expand Up @@ -47,6 +46,7 @@ class TestController implements CrudController<TestEntity> {
})
class TestModule {}

const TEST_LISTEN_PORT = 3339;
describe('Search complex conditions', () => {
let app: INestApplication;

Expand All @@ -56,6 +56,8 @@ describe('Search complex conditions', () => {
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);

await Promise.all(
Array.from({ length: 10 }, (_, index) => index).map((no) =>
Expand Down
3 changes: 3 additions & 0 deletions spec/sub-path/sub-path-more-than-one-parent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import request from 'supertest';
import { SubPathModule } from './sub-path.module';
import { TestHelper } from '../test.helper';

const TEST_LISTEN_PORT = 3339;
describe('Subpath - more then one parent parameter', () => {
let app: INestApplication;

Expand All @@ -14,6 +15,8 @@ describe('Subpath - more then one parent parameter', () => {
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);

/**
* | parentId | subId | name |
Expand Down
3 changes: 3 additions & 0 deletions spec/sub-path/sub-path-one-parent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DepthOneEntity } from './depth-one.entity';
import { SubPathModule } from './sub-path.module';
import { TestHelper } from '../test.helper';

const TEST_LISTEN_PORT = 3339;
describe('Subpath - one parent parameter', () => {
let app: INestApplication;

Expand All @@ -15,6 +16,8 @@ describe('Subpath - one parent parameter', () => {
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
// FIXME: There is a problem that read ECONNRESET error occurs in node20
await app.listen(TEST_LISTEN_PORT);
});

beforeEach(async () => {
Expand Down

0 comments on commit 5779d62

Please sign in to comment.