yamltest 1.0.0 → 1.0.1
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/README.md +6 -6
- package/package.json +3 -2
- package/src/cli.js +8 -8
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ npm install -g /path/to/YAMLTest
|
|
|
23
23
|
# Or run directly without installing
|
|
24
24
|
node /path/to/YAMLTest/src/cli.js -f your-tests.yaml
|
|
25
25
|
|
|
26
|
-
# Or link it for development (makes
|
|
26
|
+
# Or link it for development (makes YAMLTest available system-wide, auto-updates)
|
|
27
27
|
cd /path/to/YAMLTest && npm link
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ npm install --save-dev /path/to/YAMLTest
|
|
|
38
38
|
## Quick start
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
|
|
41
|
+
YAMLTest -f - <<EOF
|
|
42
42
|
- name: httpbin returns 200
|
|
43
43
|
http:
|
|
44
44
|
url: "https://httpbin.org"
|
|
@@ -66,8 +66,8 @@ Output:
|
|
|
66
66
|
|
|
67
67
|
```
|
|
68
68
|
USAGE
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
YAMLTest -f <file.yaml>
|
|
70
|
+
YAMLTest -f - # read from stdin (heredoc)
|
|
71
71
|
|
|
72
72
|
OPTIONS
|
|
73
73
|
-f, --file <path|-> YAML file to run, or - for stdin
|
|
@@ -409,7 +409,7 @@ http:
|
|
|
409
409
|
## Debug logging
|
|
410
410
|
|
|
411
411
|
```bash
|
|
412
|
-
DEBUG_MODE=true
|
|
412
|
+
DEBUG_MODE=true YAMLTest -f tests.yaml
|
|
413
413
|
```
|
|
414
414
|
|
|
415
415
|
Prints full request/response details, comparison results, and kubectl commands.
|
|
@@ -423,7 +423,7 @@ src/
|
|
|
423
423
|
core.js # Test execution engine (HTTP, command, wait, comparison)
|
|
424
424
|
runner.js # Multi-test orchestration (YAML parsing, fail-fast, retry)
|
|
425
425
|
index.js # Public API
|
|
426
|
-
cli.js #
|
|
426
|
+
cli.js # YAMLTest binary entry point
|
|
427
427
|
test/
|
|
428
428
|
unit/ # Pure function tests (compareValue, filterJson, parseCurl, ...)
|
|
429
429
|
integration/ # Real HTTP server + real shell command tests
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yamltest",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Declarative YAML-based HTTP, command, and Kubernetes test runner",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
7
|
+
"YAMLTest": "./src/cli.js",
|
|
8
|
+
"yamltest": "./src/cli.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"src/",
|
package/src/cli.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* YAMLTest CLI
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* YAMLTest -f <file.yaml>
|
|
9
|
+
* YAMLTest -f - # read from stdin
|
|
10
|
+
* YAMLTest -f <<EOF
|
|
11
11
|
* - name: test
|
|
12
12
|
* http: { url: "http://...", method: GET, path: "/" }
|
|
13
13
|
* source: { type: local }
|
|
@@ -56,12 +56,12 @@ function printUsage() {
|
|
|
56
56
|
process.stdout.write(
|
|
57
57
|
[
|
|
58
58
|
'',
|
|
59
|
-
c.bold('
|
|
59
|
+
c.bold('YAMLTest') + ' – declarative YAML test runner',
|
|
60
60
|
'',
|
|
61
61
|
c.bold('USAGE'),
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
62
|
+
' YAMLTest -f <file.yaml>',
|
|
63
|
+
' YAMLTest -f - # read YAML from stdin',
|
|
64
|
+
' YAMLTest -f <<EOF',
|
|
65
65
|
' - name: my-test',
|
|
66
66
|
' http:',
|
|
67
67
|
' url: "http://example.com"',
|