Skip to content

Commit b344459

Browse files
committed
fix: update test imports and adapterTests usage for ESM
- Change feathers and errors to named imports from default imports - Update adapterTests to use new API with test names array - Fix imports in test/core/create.ts and test/core/update.ts - All TypeScript compilation and linting passes
1 parent 68b2549 commit b344459

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

test/core/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai'
2-
import errors from '@feathersjs/errors'
2+
import { errors } from '@feathersjs/errors'
33

44
function create(app: any, serviceName: string) {
55
describe('create()', () => {

test/core/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai'
2-
import errors from '@feathersjs/errors'
2+
import { errors } from '@feathersjs/errors'
33

44
function update(app: any, serviceName: string) {
55
describe('update()', () => {

test/index.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect } from 'chai'
22
import adapterTests from '@feathersjs/adapter-tests'
33

4-
import feathers from '@feathersjs/feathers'
5-
import errors from '@feathersjs/errors'
4+
import { feathers } from '@feathersjs/feathers'
5+
import { errors } from '@feathersjs/errors'
66
import service from '../lib/index.js'
77
import * as db from './test-db.js'
88
import * as coreTests from './core/index.js'
@@ -19,7 +19,6 @@ describe('Elasticsearch Service', () => {
1919
`/${serviceName}`,
2020
service({
2121
Model: db.getClient(),
22-
events: ['testing'],
2322
id: 'id',
2423
esVersion,
2524
elasticsearch: db.getServiceConfig(serviceName),
@@ -67,7 +66,17 @@ describe('Elasticsearch Service', () => {
6766
})
6867
})
6968

70-
adapterTests(app, errors, 'people', 'id')
69+
adapterTests([
70+
'.id', '.options', '.events', '._get', '._find', '._create', '._update', '._patch', '._remove',
71+
'.$get', '.$find', '.$create', '.$update', '.$patch', '.$remove',
72+
'.get', '.get + $select', '.get + id + query', '.get + NotFound', '.find', '.remove',
73+
'.remove + $select', '.remove + id + query', '.remove + multi', '.update', '.update + $select',
74+
'.patch', '.patch + $select', '.patch multiple', '.create', '.create + $select', '.create multi',
75+
'internal .find', 'internal .get', 'internal .create', 'internal .update', 'internal .patch', 'internal .remove',
76+
'.find + equal', '.find + $sort', '.find + $limit', '.find + $skip', '.find + $select',
77+
'.find + $or', '.find + $in', '.find + $lt', '.find + $gt', '.find + $ne',
78+
'.find + paginate', 'params.adapter + paginate'
79+
])(app, errors, 'people', 'id')
7180

7281
describe('Specific Elasticsearch tests', () => {
7382
before(async () => {

0 commit comments

Comments
 (0)