Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs outdated? #239

Open
pquerner opened this issue May 11, 2024 · 4 comments
Open

docs outdated? #239

pquerner opened this issue May 11, 2024 · 4 comments

Comments

@pquerner
Copy link

Hey,

wanted to try this to test how a API endpoint behaves under load, so I began reading some docs and reading some files.
I found this one puzzling:

https://github.com/alexfernandez/loadtest/blob/main/doc/api.md#start-test-server

To start the test server use the exported function startServer() with a set of options:

import {startServer} from 'loadtest'
const server = await startServer({port: 8000})
// do your thing
await server.close()

but for me loadtest does not give such function. I've installed 8.0.9.

Then I tried following https://github.com/alexfernandez/loadtest/blob/main/test/body-generator.js however, this used the startServer differently as shown in the docs. Because this test folder sits directly next to the library.

Soo.. what am I to do?

@alexfernandez
Copy link
Owner

You should definitely have a startServer() function, it's exported. What functions do you have exported?

@pquerner
Copy link
Author

pquerner commented May 11, 2024

Its not visible in index.d.ts, maybe thats why?
I see it exported in the index.js file, but would that work for a .ts file? It doesnt know that?

@alexfernandez
Copy link
Owner

Oh, you are right! I don't use TypeScript so I have not found this issue. Care to send a patch to update index.d.ts?

@pquerner
Copy link
Author

Mh I dont really know how. I will investigate if I do this right. Maybe some other typescript user here? ^^

I tried npx -p typescript tsc lib/**/*.js --declaration --allowJs --emitDeclarationOnly --outFile index.d.ts but the git diff is really scary big.

diff.txt

from: https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants