Skip to content

Commit 1a9c4e6

Browse files
improved ServiceHandler to use existing config instead of re-reading (#223)
1 parent d260295 commit 1a9c4e6

File tree

11 files changed

+818
-275
lines changed

11 files changed

+818
-275
lines changed

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1010
:pencil: - chore
1111
:microscope: - experimental
1212

13+
## 2.1.2
14+
- :beetle: improved ServiceHandler to use existing config instead of re-reading
15+
1316
## 2.1.1
1417
- :pencil: bump memory version
1518

README.MD

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,50 @@ it will override $url memory value
2525
### Service
2626
Services is an entities that can execute logic before and after whole test run.
2727

28-
```javascript
29-
module.exports = {
30-
default: {
31-
service: [{
28+
```typescript
29+
import externalService from './externalService';
30+
31+
export default {
32+
service: [
33+
{
34+
options: {
35+
data: 42
36+
},
37+
before() {
38+
console.log(this.options.data);
39+
},
3240
after(result) {
3341
if (!result.success) process.exitCode = 1;
3442
}
35-
}]
36-
}
43+
},
44+
{
45+
options: {
46+
data: 42
47+
},
48+
...externalService
49+
}
50+
]
3751
}
3852
```
3953
There is a one minute-long default timeout for a before and after test logic to prevent entire process from freezing.
4054
To set up a custom timeout in milliseconds use serviceTimeout property in the config file
41-
```javascript
42-
module.exports = {
43-
default: {
44-
serviceTimeout: 1_200_000
45-
}
55+
```typescript
56+
export default {
57+
serviceTimeout: 1_200_000
4658
}
4759
```
4860

4961
### Pass CLI params to workers
5062
All params that you passed to qavajs cli will be available in CLI_ARGV environment variable in all child workers.
5163

5264
### Override step definition
53-
```javascript
54-
const { Override } = require('@qavajs/core/utils');
5565

56-
When('I do test', async function() {});
66+
```typescript
67+
import { Override } from '@qavajs/core/utils';
68+
69+
When('I do test', async function () {});
5770

58-
Override('I do test', async function() {
71+
Override('I do test', async function () {
5972
console.log('I am overridden');
6073
});
6174
```

0 commit comments

Comments
 (0)