xunit.ts 1.0.1 → 1.1.0
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/.editorconfig +2 -0
- package/.eslintrc.json +37 -0
- package/README.md +6 -2
- package/cli.ts +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/src/Assertions/Contains.js +1 -1
- package/dist/src/Assertions/Contains.js.map +1 -1
- package/dist/src/Assertions/Count.js.map +1 -1
- package/dist/src/Assertions/Defined.js +2 -2
- package/dist/src/Assertions/Defined.js.map +1 -1
- package/dist/src/Assertions/DoesNotContain.js +1 -1
- package/dist/src/Assertions/DoesNotContain.js.map +1 -1
- package/dist/src/Assertions/DoesNotThrow.js +2 -2
- package/dist/src/Assertions/DoesNotThrow.js.map +1 -1
- package/dist/src/Assertions/Empty.js +1 -1
- package/dist/src/Assertions/Empty.js.map +1 -1
- package/dist/src/Assertions/Equal.js +1 -1
- package/dist/src/Assertions/Equal.js.map +1 -1
- package/dist/src/Assertions/False.js +1 -1
- package/dist/src/Assertions/False.js.map +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts +1 -1
- package/dist/src/Assertions/InstanceOf.d.ts.map +1 -1
- package/dist/src/Assertions/InstanceOf.js +1 -1
- package/dist/src/Assertions/InstanceOf.js.map +1 -1
- package/dist/src/Assertions/NotEmpty.js +2 -2
- package/dist/src/Assertions/NotEmpty.js.map +1 -1
- package/dist/src/Assertions/NotEqual.js +1 -1
- package/dist/src/Assertions/NotEqual.js.map +1 -1
- package/dist/src/Assertions/NotNull.js +2 -2
- package/dist/src/Assertions/NotNull.js.map +1 -1
- package/dist/src/Assertions/Null.js +1 -1
- package/dist/src/Assertions/Null.js.map +1 -1
- package/dist/src/Assertions/StringContains.js +1 -1
- package/dist/src/Assertions/StringContains.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotContain.js +1 -1
- package/dist/src/Assertions/StringDoesNotContain.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js +1 -1
- package/dist/src/Assertions/StringDoesNotEndWith.js.map +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.js +1 -1
- package/dist/src/Assertions/StringDoesNotStartWith.js.map +1 -1
- package/dist/src/Assertions/StringEndsWith.js +1 -1
- package/dist/src/Assertions/StringEndsWith.js.map +1 -1
- package/dist/src/Assertions/StringStartsWith.d.ts.map +1 -1
- package/dist/src/Assertions/StringStartsWith.js +1 -1
- package/dist/src/Assertions/StringStartsWith.js.map +1 -1
- package/dist/src/Assertions/Throws.js +1 -1
- package/dist/src/Assertions/Throws.js.map +1 -1
- package/dist/src/Assertions/True.js +1 -1
- package/dist/src/Assertions/True.js.map +1 -1
- package/dist/src/Assertions/Undefined.js +1 -1
- package/dist/src/Assertions/Undefined.js.map +1 -1
- package/dist/src/Assertions/index.d.ts +22 -22
- package/dist/src/Assertions/index.d.ts.map +1 -1
- package/dist/src/Assertions/index.js.map +1 -1
- package/dist/src/CLI.d.ts.map +1 -1
- package/dist/src/CLI.js +19 -8
- package/dist/src/CLI.js.map +1 -1
- package/dist/src/Factory.d.ts +4 -4
- package/dist/src/Factory.d.ts.map +1 -1
- package/dist/src/Factory.js.map +1 -1
- package/dist/src/Framework/ResultType.d.ts.map +1 -1
- package/dist/src/Framework/ResultType.js.map +1 -1
- package/dist/src/Framework/Test.d.ts.map +1 -1
- package/dist/src/Framework/Test.js.map +1 -1
- package/dist/src/Framework/TestName.d.ts.map +1 -1
- package/dist/src/Framework/TestName.js.map +1 -1
- package/dist/src/Framework/TestResult.d.ts.map +1 -1
- package/dist/src/Framework/TestResult.js.map +1 -1
- package/dist/src/Framework/TestSuite.d.ts +3 -2
- package/dist/src/Framework/TestSuite.d.ts.map +1 -1
- package/dist/src/Framework/TestSuite.js +12 -2
- package/dist/src/Framework/TestSuite.js.map +1 -1
- package/dist/src/Framework/TestSuiteResults.d.ts +1 -1
- package/dist/src/Framework/TestSuiteResults.d.ts.map +1 -1
- package/dist/src/Framework/TestSuiteResults.js.map +1 -1
- package/dist/src/IO/FileSystem.d.ts +2 -2
- package/dist/src/IO/FileSystem.d.ts.map +1 -1
- package/dist/src/IO/FileSystem.js +6 -6
- package/dist/src/IO/FileSystem.js.map +1 -1
- package/dist/src/IO/Output.d.ts.map +1 -1
- package/dist/src/IO/Output.js.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.d.ts.map +1 -1
- package/dist/src/Reporters/ConsoleReporter.js +8 -7
- package/dist/src/Reporters/ConsoleReporter.js.map +1 -1
- package/dist/src/Reporters/FileReporter.d.ts.map +1 -1
- package/dist/src/Reporters/FileReporter.js +1 -0
- package/dist/src/Reporters/FileReporter.js.map +1 -1
- package/dist/src/Reporters/JUnitReporter.d.ts +2 -2
- package/dist/src/Reporters/JUnitReporter.d.ts.map +1 -1
- package/dist/src/Reporters/JUnitReporter.js +7 -7
- package/dist/src/Reporters/JUnitReporter.js.map +1 -1
- package/dist/src/Reporters/ResultReporter.d.ts +3 -3
- package/dist/src/Reporters/ResultReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.d.ts +2 -2
- package/dist/src/Reporters/SonarReporter.d.ts.map +1 -1
- package/dist/src/Reporters/SonarReporter.js +16 -16
- package/dist/src/Reporters/SonarReporter.js.map +1 -1
- package/dist/src/Reporters/XMLReporter.d.ts.map +1 -1
- package/dist/src/Reporters/XMLReporter.js.map +1 -1
- package/dist/src/Runners/Runner.d.ts +3 -3
- package/dist/src/Runners/Runner.d.ts.map +1 -1
- package/dist/src/Runners/Runner.js +8 -8
- package/dist/src/Runners/Runner.js.map +1 -1
- package/dist/src/Runners/TestRunner.d.ts +4 -4
- package/dist/src/Runners/TestRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestRunner.js +4 -4
- package/dist/src/Runners/TestRunner.js.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.d.ts +4 -4
- package/dist/src/Runners/TestSuiteLoader.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteLoader.js +21 -18
- package/dist/src/Runners/TestSuiteLoader.js.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.d.ts +6 -6
- package/dist/src/Runners/TestSuiteRunner.d.ts.map +1 -1
- package/dist/src/Runners/TestSuiteRunner.js +3 -3
- package/dist/src/Runners/TestSuiteRunner.js.map +1 -1
- package/dist/xunit.d.ts +3 -3
- package/dist/xunit.d.ts.map +1 -1
- package/dist/xunit.js.map +1 -1
- package/icon.svg +74 -75
- package/logo.svg +130 -130
- package/package.json +44 -37
- package/src/Assertions/Contains.ts +10 -10
- package/src/Assertions/Count.ts +11 -11
- package/src/Assertions/Defined.ts +11 -11
- package/src/Assertions/DoesNotContain.ts +11 -11
- package/src/Assertions/DoesNotThrow.ts +13 -13
- package/src/Assertions/Empty.ts +11 -11
- package/src/Assertions/Equal.ts +12 -12
- package/src/Assertions/False.ts +11 -11
- package/src/Assertions/InstanceOf.ts +13 -13
- package/src/Assertions/NotEmpty.ts +11 -11
- package/src/Assertions/NotEqual.ts +12 -12
- package/src/Assertions/NotNull.ts +11 -11
- package/src/Assertions/Null.ts +11 -11
- package/src/Assertions/StringContains.ts +11 -11
- package/src/Assertions/StringDoesNotContain.ts +12 -12
- package/src/Assertions/StringDoesNotEndWith.ts +13 -13
- package/src/Assertions/StringDoesNotStartWith.ts +12 -12
- package/src/Assertions/StringEndsWith.ts +13 -13
- package/src/Assertions/StringStartsWith.ts +12 -12
- package/src/Assertions/Throws.ts +11 -11
- package/src/Assertions/True.ts +11 -11
- package/src/Assertions/Undefined.ts +12 -12
- package/src/Assertions/index.ts +45 -45
- package/src/CLI.ts +96 -85
- package/src/Factory.ts +25 -25
- package/src/Framework/ResultType.ts +4 -4
- package/src/Framework/Test.ts +6 -6
- package/src/Framework/TestName.ts +7 -7
- package/src/Framework/TestResult.ts +3 -2
- package/src/Framework/TestSuite.ts +29 -18
- package/src/Framework/TestSuiteResults.ts +17 -16
- package/src/IO/FileSystem.ts +28 -29
- package/src/IO/Output.ts +21 -20
- package/src/Reporters/ConsoleReporter.ts +88 -87
- package/src/Reporters/FileReporter.ts +29 -29
- package/src/Reporters/JUnitReporter.ts +80 -80
- package/src/Reporters/ResultReporter.ts +20 -12
- package/src/Reporters/SonarReporter.ts +86 -86
- package/src/Reporters/XMLReporter.ts +6 -6
- package/src/Runners/Runner.ts +21 -21
- package/src/Runners/TestRunner.ts +34 -33
- package/src/Runners/TestSuiteLoader.ts +52 -45
- package/src/Runners/TestSuiteRunner.ts +27 -26
- package/tsconfig.json +26 -26
- package/xunit.ts +6 -6
package/logo.svg
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
2
|
<svg
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
xml:space="preserve"><tspan
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
7
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
inkscape:export-ydpi="96"
|
|
10
|
+
inkscape:export-xdpi="96"
|
|
11
|
+
inkscape:export-filename="X:\ecoAPM\xunit.ts\logo-black.png"
|
|
12
|
+
sodipodi:docname="logo.svg"
|
|
13
|
+
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
14
|
+
id="svg8"
|
|
15
|
+
version="1.1"
|
|
16
|
+
viewBox="0 0 400 128"
|
|
17
|
+
height="128"
|
|
18
|
+
width="400">
|
|
19
|
+
<defs
|
|
20
|
+
id="defs2">
|
|
21
|
+
<rect
|
|
22
|
+
id="rect2858"
|
|
23
|
+
height="56"
|
|
24
|
+
width="61.5"
|
|
25
|
+
y="39"
|
|
26
|
+
x="127.5"/>
|
|
27
|
+
<rect
|
|
28
|
+
id="rect2746"
|
|
29
|
+
height="38.364582"
|
|
30
|
+
width="5.0270834"
|
|
31
|
+
y="94.720833"
|
|
32
|
+
x="102.39375"/>
|
|
33
|
+
</defs>
|
|
34
|
+
<sodipodi:namedview
|
|
35
|
+
inkscape:window-maximized="1"
|
|
36
|
+
inkscape:window-y="-8"
|
|
37
|
+
inkscape:window-x="-8"
|
|
38
|
+
inkscape:window-height="1137"
|
|
39
|
+
inkscape:window-width="1920"
|
|
40
|
+
inkscape:pagecheckerboard="false"
|
|
41
|
+
units="px"
|
|
42
|
+
showgrid="false"
|
|
43
|
+
inkscape:document-rotation="0"
|
|
44
|
+
inkscape:current-layer="layer1"
|
|
45
|
+
inkscape:document-units="px"
|
|
46
|
+
inkscape:cy="111.1524"
|
|
47
|
+
inkscape:cx="243.86486"
|
|
48
|
+
inkscape:zoom="2"
|
|
49
|
+
inkscape:pageshadow="2"
|
|
50
|
+
inkscape:pageopacity="0"
|
|
51
|
+
borderopacity="1.0"
|
|
52
|
+
bordercolor="#666666"
|
|
53
|
+
pagecolor="#000000"
|
|
54
|
+
id="base"/>
|
|
55
|
+
<metadata
|
|
56
|
+
id="metadata5">
|
|
57
|
+
<rdf:RDF>
|
|
58
|
+
<cc:Work
|
|
59
|
+
rdf:about="">
|
|
60
|
+
<dc:format>image/svg+xml</dc:format>
|
|
61
|
+
<dc:type
|
|
62
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
|
63
|
+
<dc:title></dc:title>
|
|
64
|
+
</cc:Work>
|
|
65
|
+
</rdf:RDF>
|
|
66
|
+
</metadata>
|
|
67
|
+
<g
|
|
68
|
+
id="layer1"
|
|
69
|
+
inkscape:groupmode="layer"
|
|
70
|
+
inkscape:label="Layer 1">
|
|
71
|
+
<text
|
|
72
|
+
id="text2742"
|
|
73
|
+
y="168.27499"
|
|
74
|
+
x="-11.377083"
|
|
75
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;line-height:1.25;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
76
|
+
xml:space="preserve"><tspan
|
|
78
77
|
sodipodi:role="line"
|
|
79
78
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';stroke-width:0.264583"
|
|
80
79
|
y="168.27499"
|
|
81
80
|
x="-11.377083"
|
|
82
|
-
id="tspan2740"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
id="tspan2740" />
|
|
82
|
+
<tspan
|
|
83
|
+
id="tspan2754"
|
|
84
|
+
sodipodi:role="line"
|
|
85
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:127px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';stroke-width:0.264583"
|
|
86
|
+
y="327.02499"
|
|
87
|
+
x="-11.377083"/></text>
|
|
88
|
+
<text
|
|
89
|
+
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect2746);fill:#000000;fill-opacity:1;stroke:none;"
|
|
90
|
+
id="text2744"
|
|
91
|
+
xml:space="preserve"/>
|
|
92
|
+
<text
|
|
93
|
+
id="text2752"
|
|
94
|
+
y="26.987499"
|
|
95
|
+
x="35.983334"
|
|
96
|
+
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
97
|
+
xml:space="preserve"><tspan
|
|
98
98
|
style="stroke-width:0.264583"
|
|
99
99
|
y="26.987499"
|
|
100
100
|
x="35.983334"
|
|
101
101
|
id="tspan2750"
|
|
102
102
|
sodipodi:role="line" /></text>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
<text
|
|
104
|
+
transform="scale(0.99994519,1.0000548)"
|
|
105
|
+
id="text2758"
|
|
106
|
+
y="98.652382"
|
|
107
|
+
x="112.43309"
|
|
108
|
+
style="font-style:normal;font-weight:normal;font-size:95.8669px;line-height:0;font-family:sans-serif;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.264216"
|
|
109
|
+
xml:space="preserve"><tspan
|
|
110
110
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:95.8669px;line-height:1;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';fill:#000000;fill-opacity:1;stroke-width:0.264216"
|
|
111
111
|
y="98.652382"
|
|
112
112
|
x="112.43309"
|
|
@@ -114,41 +114,41 @@
|
|
|
114
114
|
sodipodi:role="line"><tspan
|
|
115
115
|
id="tspan3014"
|
|
116
116
|
style="fill:#ffffff;fill-opacity:1">unit</tspan><tspan
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
117
|
+
id="tspan3000"
|
|
118
|
+
style="fill:#808080;fill-opacity:1">.</tspan><tspan
|
|
119
|
+
id="tspan3016"
|
|
120
|
+
style="fill:#ffffff;fill-opacity:1">ts</tspan></tspan></text>
|
|
121
|
+
<text
|
|
122
|
+
style="fill:black;fill-opacity:1;line-height:1.25;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;white-space:pre;shape-inside:url(#rect2858);"
|
|
123
|
+
id="text2856"
|
|
124
|
+
xml:space="preserve"/>
|
|
125
|
+
</g>
|
|
126
|
+
<g
|
|
127
|
+
inkscape:label="Layer 2"
|
|
128
|
+
id="layer2"
|
|
129
|
+
inkscape:groupmode="layer">
|
|
130
|
+
<g
|
|
131
|
+
transform="matrix(-3.7140083,0,0,3.7296903,884.38712,-159.89914)"
|
|
132
|
+
style="font-style:normal;font-weight:normal;font-size:50.8px;line-height:1.25;font-family:sans-serif;fill:#bfbfbf;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
|
133
|
+
id="text2766-0"
|
|
134
|
+
aria-label="🗸">
|
|
135
|
+
<path
|
|
136
|
+
sodipodi:nodetypes="ccsccccc"
|
|
137
|
+
id="path2805"
|
|
138
|
+
style="font-size:50.8px;fill:#bfbfbf;fill-opacity:1;stroke-width:0.264583"
|
|
139
|
+
d="m 231.8494,43.408198 0.74414,1.289843 c -4.84518,3.423047 -9.33483,7.755599 -13.46894,12.997656 -4.13412,5.242057 -7.11895,10.376628 -8.9545,15.403711 l -1.0914,0.719336 c -0.94258,0.611849 -1.75287,1.223698 -2.43086,1.835547 -1.21639,-4.400349 7.20052,-16.248511 12.05508,-21.480859 4.15065,-4.415235 8.53281,-8.003646 13.14648,-10.765234 z"/>
|
|
140
|
+
</g>
|
|
141
|
+
<text
|
|
142
|
+
transform="scale(0.99789547,1.002109)"
|
|
143
|
+
xml:space="preserve"
|
|
144
|
+
style="font-style:normal;font-weight:normal;font-size:189.07px;line-height:1.25;font-family:sans-serif;fill:#538d43;fill-opacity:1;stroke:none;stroke-width:0.984736"
|
|
145
|
+
x="-11.659009"
|
|
146
|
+
y="150.47635"
|
|
147
|
+
id="text2766"><tspan
|
|
148
148
|
sodipodi:role="line"
|
|
149
149
|
id="tspan2764"
|
|
150
150
|
x="-11.659009"
|
|
151
151
|
y="150.47635"
|
|
152
152
|
style="font-size:189.07px;fill:#538d43;fill-opacity:1;stroke-width:0.984736">🗸</tspan></text>
|
|
153
|
-
|
|
153
|
+
</g>
|
|
154
154
|
</svg>
|
package/package.json
CHANGED
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
"name": "xunit.ts",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A unit testing framework for TypeScript, following standard xUnit patterns",
|
|
5
|
+
"main": "dist/xunit.js",
|
|
6
|
+
"author": "ecoAPM LLC",
|
|
7
|
+
"homepage": "https://github.com/ecoAPM/xunit.ts",
|
|
8
|
+
"bugs": "https://github.com/ecoAPM/xunit.ts/issues",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"colors": "1.4.0",
|
|
12
|
+
"command-line-args": "5.2.1",
|
|
13
|
+
"command-line-usage": "6.1.1",
|
|
14
|
+
"lodash.isequal": "4.5.0",
|
|
15
|
+
"xml": "1.0.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@microsoft/tsdoc": "0.13.2",
|
|
19
|
+
"@types/command-line-args": "5.2.0",
|
|
20
|
+
"@types/command-line-usage": "5.0.2",
|
|
21
|
+
"@types/lodash.isequal": "4.5.5",
|
|
22
|
+
"@types/node": "17.0.19",
|
|
23
|
+
"@types/xml": "1.0.8",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "5.12.1",
|
|
25
|
+
"@typescript-eslint/parser": "5.12.1",
|
|
26
|
+
"eslint": "8.9.0",
|
|
27
|
+
"notosans": "5.0.0",
|
|
28
|
+
"ts-mockito": "2.6.1",
|
|
29
|
+
"ts-node": "10.5.0",
|
|
30
|
+
"typescript": "4.5.5"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"typescript": "^4.0.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"clean": "rm -rf dist",
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"test": "node dist/cli.js dist/tests",
|
|
39
|
+
"xunit": "ts-node cli.ts",
|
|
40
|
+
"tsdoc": "cp -r node_modules/notosans/* docs/assets && ts-node tsdoc.ts"
|
|
41
|
+
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"xunit": "dist/cli.js"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -2,10 +2,10 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array contains a given element
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if array `haystack` contains an element with a value of `needle`
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if array `haystack` does not contain an element with a value of `needle`
|
|
10
10
|
*
|
|
11
11
|
* @param needle the element to find
|
|
@@ -16,13 +16,13 @@ import { AssertionError } from "assert";
|
|
|
16
16
|
* this.assert.contains(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function Contains<T>(needle: T, haystack: ReadonlyArray<T>, message?: string) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (haystack.includes(needle)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
throw new AssertionError({
|
|
24
|
+
message: message || "Expected array containing expression, but array did not contain expression",
|
|
25
|
+
expected: needle,
|
|
26
|
+
actual: haystack
|
|
27
|
+
});
|
|
28
28
|
}
|
package/src/Assertions/Count.ts
CHANGED
|
@@ -2,27 +2,27 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array contains a certain number of elements
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if `array` contains `expected` number of elements
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if `array` does not contain `expected` number of elements
|
|
10
10
|
*
|
|
11
11
|
* @param expected the number of array elements expected
|
|
12
12
|
* @param array the array to check the length of
|
|
13
13
|
* @param message (optional) message to display on failure
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.count(expected, array);
|
|
17
17
|
*/
|
|
18
18
|
export default function Count(expected: number, array: ReadonlyArray<any>, message?: string) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (array.length === expected) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
throw new AssertionError({
|
|
24
|
+
message: message || `Expected array with ${expected} elements, but array had ${array.length} elements`,
|
|
25
|
+
expected: expected,
|
|
26
|
+
actual: array.length
|
|
27
|
+
});
|
|
28
28
|
}
|
|
@@ -2,26 +2,26 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that a value is defined (any value other than `undefined`)
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if `expression` does not evaluate to `undefined`
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if `expression` evaluates to `undefined`
|
|
10
10
|
*
|
|
11
11
|
* @param expression the value to check
|
|
12
12
|
* @param message (optional) message to display on failure
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.defined(expression);
|
|
16
16
|
*/
|
|
17
17
|
export default function Defined(expression: any, message?: string) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (expression !== undefined) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
throw new AssertionError({
|
|
23
|
+
message: message || "Expected expression to be defined, but expression is undefined",
|
|
24
|
+
expected: "(not undefined expression)",
|
|
25
|
+
actual: expression
|
|
26
|
+
});
|
|
27
27
|
}
|
|
@@ -2,27 +2,27 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array does not contain a given element
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if array `haystack` does not contain an element with a value of `needle`
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if array `haystack` contains an element with a value of `needle`
|
|
10
10
|
*
|
|
11
11
|
* @param needle the element to find
|
|
12
12
|
* @param haystack the array to search
|
|
13
13
|
* @param message (optional) message to display on failure
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @example
|
|
16
16
|
* this.assert.doesNotContain(needle, haystack);
|
|
17
17
|
*/
|
|
18
18
|
export default function DoesNotContain<T>(needle: T, haystack: ReadonlyArray<T>, message?: string) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (!haystack.includes(needle)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
throw new AssertionError({
|
|
24
|
+
message: message || "Expected array not containing expression, but array contained expression",
|
|
25
|
+
expected: needle,
|
|
26
|
+
actual: haystack
|
|
27
|
+
});
|
|
28
28
|
}
|
|
@@ -2,27 +2,27 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an expression does not throw an error/exception
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if calling `expression` does not throw an error/exception
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if calling `expression` throws an error/exception
|
|
10
10
|
*
|
|
11
11
|
* @param expression the expression to run
|
|
12
12
|
* @param message (optional) message to display on failure
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.doesNotThrow(() => expression);
|
|
16
16
|
*/
|
|
17
17
|
export default function DoesNotThrow(expression: () => any, message?: string) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
try {
|
|
19
|
+
expression();
|
|
20
|
+
return;
|
|
21
|
+
} catch (exception) {
|
|
22
|
+
throw new AssertionError({
|
|
23
|
+
message: message || "Expected expression to not throw exception, but expression did throw exception",
|
|
24
|
+
expected: "(no exception)",
|
|
25
|
+
actual: exception
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
28
|
}
|
package/src/Assertions/Empty.ts
CHANGED
|
@@ -2,26 +2,26 @@ import { AssertionError } from "assert";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Asserts that an array is empty
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* Passes if `array` contains zero elements
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* Fails if `array` contains any elements
|
|
10
10
|
*
|
|
11
11
|
* @param array the array to check
|
|
12
12
|
* @param message (optional) message to display on failure
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* @example
|
|
15
15
|
* this.assert.empty(array);
|
|
16
16
|
*/
|
|
17
17
|
export default function Empty(array: ReadonlyArray<any>, message?: string) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (array.length === 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
throw new AssertionError({
|
|
23
|
+
message: message || "Expected expression to be empty, but expression was not empty",
|
|
24
|
+
expected: [],
|
|
25
|
+
actual: array
|
|
26
|
+
});
|
|
27
27
|
}
|