Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ksxgithub/deno_run_tests_on_localhost
Create a localhost server and run tests
https://github.com/ksxgithub/deno_run_tests_on_localhost
cli deno javascript localhost testing typescript
Last synced: about 1 month ago
JSON representation
Create a localhost server and run tests
- Host: GitHub
- URL: https://github.com/ksxgithub/deno_run_tests_on_localhost
- Owner: KSXGitHub
- License: mit
- Created: 2020-04-12T13:46:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-18T02:29:48.000Z (over 4 years ago)
- Last Synced: 2024-11-14T12:06:44.855Z (about 2 months ago)
- Topics: cli, deno, javascript, localhost, testing, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/test_on_localhost
- Size: 29.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Test on LocalHost
Create a localhost server and run tests.
## Usage
### Programmatically
```javascript
import run from "https://deno.land/x/[email protected]/run.ts";const { success, code } = await run({
hostname: "0.0.0.0",
port: 8080,
list: ["test/foo.ts", "test/bar.ts"],
});if (success) {
console.log("all tests passed.");
} else {
console.log("some tests failed.");
console.log("status", status);
Deno.exit(status);
}
```### Command-Line
File [cli.ts](./cli.ts) can be used as your test runner cli.
```sh
deno -A https://deno.land/x/[email protected]/cli.ts \
--host 0.0.0.0 \
--port 8080 \
test/foo.ts test/bar.ts
```### Real-world Examples
* https://github.com/KSXGitHub/yaml-wasm/blob/2ac301cf5ac9f72f88ef1f46a08c74c7f6dc3e37/run-tests.ts
## License
[MIT](https://git.io/Jvjim) © [Hoàng Văn Khải](https://github.com/KSXGitHub/)