restore jest style structure

This commit is contained in:
ppetzold 2022-03-14 18:48:56 +01:00
parent 6e733f48e1
commit e84d71e540
5 changed files with 10 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import { ROUTE_ARGS_METADATA } from '@nestjs/common/constants'
import { HttpArgumentsHost, CustomParamFactory, ExecutionContext } from '@nestjs/common/interfaces' import { HttpArgumentsHost, CustomParamFactory, ExecutionContext } from '@nestjs/common/interfaces'
import { Request as ExpressRequest } from 'express' import { Request as ExpressRequest } from 'express'
import { FastifyRequest } from 'fastify' import { FastifyRequest } from 'fastify'
import { Paginate, PaginateQuery } from '../index' import { Paginate, PaginateQuery } from './decorator'
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
function getParamDecoratorFactory<T>(decorator: Function): CustomParamFactory { function getParamDecoratorFactory<T>(decorator: Function): CustomParamFactory {

View File

@ -7,12 +7,12 @@ import {
isOperator, isOperator,
getFilterTokens, getFilterTokens,
OperatorSymbolToFunction, OperatorSymbolToFunction,
} from '../index' } from './paginate'
import { PaginateQuery } from '../index' import { PaginateQuery } from './decorator'
import { HttpException } from '@nestjs/common' import { HttpException } from '@nestjs/common'
import { CatEntity } from './entity/cat.entity' import { CatEntity } from './__tests__/cat.entity'
import { CatToyEntity } from './entity/cat-toy.entity' import { CatToyEntity } from './__tests__/cat-toy.entity'
import { CatHomeEntity } from './entity/cat-home.entity' import { CatHomeEntity } from './__tests__/cat-home.entity'
import { clone } from 'lodash' import { clone } from 'lodash'
describe('paginate', () => { describe('paginate', () => {
@ -217,6 +217,10 @@ describe('paginate', () => {
expect(result.data).toStrictEqual([cats[3], cats[4], cats[1], cats[0], cats[2]]) expect(result.data).toStrictEqual([cats[3], cats[4], cats[1], cats[0], cats[2]])
}) })
/**
* search
*/
it('should return result based on search term', async () => { it('should return result based on search term', async () => {
const config: PaginateConfig<CatEntity> = { const config: PaginateConfig<CatEntity> = {
sortableColumns: ['id', 'name', 'color'], sortableColumns: ['id', 'name', 'color'],