-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestMain.hx
More file actions
50 lines (44 loc) · 1.73 KB
/
TestMain.hx
File metadata and controls
50 lines (44 loc) · 1.73 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
import openfl.display.Sprite;
import utest.Runner;
import utest.ui.Report;
class TestMain extends Sprite {
public function new() {
super();
var runner = new Runner();
runner.addCase(new feathers.validators.utils.TestValidatorStringUtil());
runner.addCase(new feathers.validators.TestCreditCardValidator());
runner.addCase(new feathers.validators.TestCurrencyValidator());
runner.addCase(new feathers.validators.TestDateValidator());
runner.addCase(new feathers.validators.TestEmailValidator());
runner.addCase(new feathers.validators.TestNumberValidator());
runner.addCase(new feathers.validators.TestPhoneNumberValidator());
runner.addCase(new feathers.validators.TestRegExpValidator());
runner.addCase(new feathers.validators.TestSocialSecurityValidator());
runner.addCase(new feathers.validators.TestStringValidator());
runner.addCase(new feathers.validators.TestZipCodeValidator());
#if (html5 && playwright)
// special case: see below for details
setupHeadlessMode(runner);
#else
// a report prints the final results after all tests have run
Report.create(runner);
#end
// don't forget to start the runner
runner.run();
}
#if (html5 && playwright)
/**
Developers using continuous integration might want to run the html5
target in a "headless" browser using playwright. To do that, add
-Dplaywright to your command line options when building.
@see https://playwright.dev
**/
private function setupHeadlessMode(runner:Runner):Void {
new utest.ui.text.PrintReport(runner);
var aggregator = new utest.ui.common.ResultAggregator(runner, true);
aggregator.onComplete.add(function(result:utest.ui.common.PackageResult):Void {
Reflect.setField(js.Lib.global, "utestResult", result);
});
}
#end
}