metarhia / metarhia/Example

`npm t` omit execution of some test cases

Open
#263 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
211
Forks
82
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Example project has tests for API in the [`application/domain/tests`](https://github.com/metarhia/Example/tree/master/application/domain/tests) folder. Specifically two tests `http.test.js` and `ws.test.js` running the same test cases from `api.js`, e.g.

https://github.com/metarhia/Example/blob/2435b8e643af3fc4a62fea1f3f20bdedc1e1d9c1/application/domain/tests/api.js#L11-L14

It seems that `Call example.add({ a, b })` don't execute during test run.

### To Reproduce

1. Open Example project in the terminal
2. Run `npm t`
3. There is no `Call example.add({ a, b })` test mentioning in the console logs despite that `Metacom over HTTP` and `Metacom over Websocket` marked as passed.

```sh
11:52:24 W1 debug ✅ Passed: Get room with domain.chat.getRoom (0.251542ms)
11:52:24 W1 debug ✅ Passed: Send message with domain.chat.send (0.097667ms)
11:52:24 W1 debug ✅ Passed: Chat test (1.12525ms)
11:52:24 W2 debug 127.0.0.1 POST /api 200
11:52:24 W2 log 127.0.0.1 system/introspect
11:52:24 W1 debug ✅ Passed: Metacom over HTTP (17.8425ms)
11:52:24 W1 debug 127.0.0.1 GET /demo.txt 200
11:52:24 W1 debug ✅ Passed: Test to serve without cache (7.318167ms)
11:52:24 W3 debug 127.0.0.1 GET / 200
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/ (7.025792ms)
11:52:24 W1 debug 127.0.0.1 GET /console.js 200
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/console.js (2.40575ms)
11:52:24 W1 error 127.0.0.1 GET /unknown 404
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/unknown (2.39425ms)
11:52:24 W1 error 127.0.0.1 GET /unknown.png 404
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/unknown.png (2.170125ms)
11:52:24 W1 error 127.0.0.1 GET /unknown/unknown 404
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/unknown/unknown (1.154375ms)
11:52:24 W1 error 127.0.0.1 GET /unknown/unknown.png 404
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/unknown/unknown.png (1.115292ms)
11:52:24 W1 debug 127.0.0.1 GET /article 200
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/article (1.617167ms)
11:52:24 W1 debug 127.0.0.1 GET /article/file.txt 200
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/article/file.txt (2.123542ms)
11:52:24 W1 debug 127.0.0.1 GET /article/name 200
11:52:24 W1 debug ✅ Passed: Get static resource: http://127.0.0.1:8000/article/name (1.464959ms)
11:52:24 W1 debug ✅ Passed: Static server test (30.391125ms)
11:52:24 W2 log 127.0.0.1 system/introspect
11:52:24 W1 debug ✅ Passed: Metacom over Websocket (5.606583ms)
11:52:24 W1 debug 🟢 Passed 16, Failed: 0
```

### Additional context

OS: macOS 14.1.2
Node: 20.9.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running `npm t` in the Example project and compare the cases in application/domain/tests/api.js with http.test.js and ws.test.js. Trace how the shared `example.add({ a, b })` cases are invoked by the HTTP and WebSocket tests. Done means the omitted cases execute and appear in the test output while the existing tests continue to pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.