-
hi, my tech stack is:
when I write all the code I need as import io from 'socket.io-client'
import { faker } from '@faker-js/faker'
import { feathers } from '@feathersjs/feathers'
import socket from '@feathersjs/socketio-client'
import { app } from '../src/app'
const port = app.get('port')
const appUrl = `http://${app.get('host')}:${port}`
describe('testing real time with socket.io', () => {
let client = feathers()
client.configure(socket(io(appUrl)))
it('create user and send user over socket', async () => {
expect.hasAssertions()
const data = {
name: faker.internet.userName(),
password: faker.internet.password(),
type: 'member'
}
client
.service('users')
.on('created', (user: { name: any }) => {
expect(user.name).toBe(data.name)
})
// Call the `users` service
await client.service('users').create(data)
})
}) the testing util will get timeout after some time. Question
thank you |
Beta Was this translation helpful? Give feedback.
Answered by
noor-tg
Nov 4, 2023
Replies: 1 comment
-
the answer is simply to use instructors from https://feathersjs.com/cookbook/general/client-test.html |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
noor-tg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the answer is simply to use instructors from https://feathersjs.com/cookbook/general/client-test.html