@toa.io/userland 1.2.0-dev.5 → 1.2.0-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/userland",
3
- "version": "1.2.0-dev.5",
3
+ "version": "1.2.0-dev.7",
4
4
  "description": "Toa development kit",
5
5
  "homepage": "https://toa.io",
6
6
  "author": {
@@ -24,14 +24,14 @@
24
24
  "main": "src/index.js",
25
25
  "types": "types/index.d.ts",
26
26
  "dependencies": {
27
- "@toa.io/boot": "1.0.2-dev.5",
28
- "@toa.io/core": "1.1.0-dev.5",
29
- "@toa.io/filesystem": "1.0.2-dev.5",
30
- "@toa.io/generic": "0.11.0-dev.5",
31
- "@toa.io/norm": "1.0.2-dev.5",
32
- "@toa.io/schemas": "0.8.4-dev.5",
33
- "@toa.io/yaml": "0.7.6-dev.5",
27
+ "@toa.io/boot": "1.0.2-dev.7",
28
+ "@toa.io/core": "1.1.0-dev.7",
29
+ "@toa.io/filesystem": "1.0.2-dev.7",
30
+ "@toa.io/generic": "0.11.0-dev.7",
31
+ "@toa.io/norm": "1.0.2-dev.7",
32
+ "@toa.io/schemas": "0.8.4-dev.7",
33
+ "@toa.io/yaml": "0.7.6-dev.7",
34
34
  "tap": "16.3.4"
35
35
  },
36
- "gitHead": "76901bfb5b9f275cfd1c85178994246ec37fea1b"
36
+ "gitHead": "2c1a77365fdc1562067902067ddeefd19d570c14"
37
37
  }
package/samples/readme.md CHANGED
@@ -92,11 +92,11 @@ context (so as required extensions). See [examples](../example/samples).
92
92
 
93
93
  ## Replay
94
94
 
95
- ### CLI
95
+ > Replaying samples requires local deployment environment.
96
96
 
97
- Samples may be *replayed* using [`toa replay`](/runtime/cli/readme.md#replay) command.
97
+ ### CLI
98
98
 
99
- > Replaying samples requires local deployment environment.
99
+ Samples may be replayed using [`toa replay`](/runtime/cli/readme.md#replay) command.
100
100
 
101
101
  See [features](/features/cli/replay.feature).
102
102
 
@@ -6,14 +6,13 @@ const replay = require('./suite')
6
6
 
7
7
  /**
8
8
  * @param {toa.samples.Suite} suite
9
+ * @param {object} options
9
10
  * @return {Promise<boolean>}
10
11
  */
11
- const test = async (suite) => {
12
- const result = await tap.test(suite.title, OPTIONS, replay.suite(suite))
12
+ const test = async (suite, options) => {
13
+ const result = await tap.test(suite.title, options, replay.suite(suite))
13
14
 
14
15
  return result === null ? false : result.ok
15
16
  }
16
17
 
17
- const OPTIONS = { bail: true }
18
-
19
18
  exports.test = test
@@ -7,7 +7,7 @@ const { replay } = require('./replay')
7
7
  const components = async (paths, options = {}) => {
8
8
  const suite = await load(paths, options)
9
9
 
10
- return await replay(suite, paths)
10
+ return await replay(suite, paths, options.runner)
11
11
  }
12
12
 
13
13
  exports.components = components
@@ -15,7 +15,7 @@ const context = async (path, options = {}) => {
15
15
  let ok = true
16
16
 
17
17
  if (options.integration !== true) ok = await test.components(paths, options)
18
- if (ok) ok = await replay(suite, paths)
18
+ if (ok) ok = await replay(suite, paths, options.runner)
19
19
 
20
20
  return ok
21
21
  }
@@ -4,10 +4,10 @@ const stage = require('@toa.io/userland/stage')
4
4
  const { test } = require('./.replay')
5
5
 
6
6
  /** @type {toa.samples.replay.replay} */
7
- const replay = async (suite, paths) => {
7
+ const replay = async (suite, paths, options) => {
8
8
  await stage.composition(paths)
9
9
 
10
- const ok = await test(suite)
10
+ const ok = await test(suite, options)
11
11
 
12
12
  await stage.shutdown()
13
13
 
@@ -2,9 +2,9 @@ import * as _suite from './suite'
2
2
 
3
3
  declare namespace toa.samples.replay {
4
4
 
5
- type components = (paths: string[], options?: _suite.Options) => Promise<boolean>
6
- type context = (path: string, options?: _suite.Options) => Promise<boolean>
7
- type replay = (suite: _suite.Suite, paths: string[]) => Promise<boolean>
5
+ type components = (paths: string[], options?: _suite.Options) => Promise<boolean>
6
+ type context = (path: string, options?: _suite.Options) => Promise<boolean>
7
+ type replay = (suite: _suite.Suite, paths: string[], options?: object) => Promise<boolean>
8
8
 
9
9
  }
10
10
 
@@ -3,24 +3,25 @@ import * as _messages from './message'
3
3
 
4
4
  declare namespace toa.samples {
5
5
 
6
- namespace suite {
7
- type Operations = Record<string, _operations.Set>
6
+ namespace suite {
7
+ type Operations = Record<string, _operations.Set>
8
8
 
9
- type Options = {
10
- id?: string
11
- integration?: boolean
12
- component?: string
13
- operation?: string
14
- title?: string
9
+ type Options = {
10
+ id?: string
11
+ integration?: boolean
12
+ component?: string
13
+ operation?: string
14
+ title?: string
15
+ runner?: object
16
+ }
15
17
  }
16
- }
17
18
 
18
- type Suite = {
19
- title: string
20
- autonomous: boolean
21
- operations?: suite.Operations
22
- messages?: _messages.Set
23
- }
19
+ type Suite = {
20
+ title: string
21
+ autonomous: boolean
22
+ operations?: suite.Operations
23
+ messages?: _messages.Set
24
+ }
24
25
 
25
26
  }
26
27