Completed
Pull Request — master (#24)
by
unknown
49s
created

testsuite.js (1 issue)

Severity
1
/*
2
 Javascript Object                               ______  ________________
3
 Inheritance Implementation                  __ / / __ \/  _/  _/\_____  \
4
                                            / // / /_/ // /_/ /    _(__  <
5
 Copyright 2014, Harold Iedema.             \___/\____/___/___/   /       \
6
 --------------------------------------------------------------- /______  / ---
7
 Permission is hereby granted, free of charge, to any person obtaining  \/
8
 a copy of this software and associated documentation files (the
9
 "Software"), to deal in the Software without restriction, including
10
 without limitation the rights to use, copy, modify, merge, publish,
11
 distribute, sublicense, and/or sell copies of the Software, and to
12
 permit persons to whom the Software is furnished to do so, subject to
13
 the following conditions:
14
15
 The above copyright notice and this permission notice shall be
16
 included in all copies or substantial portions of the Software.
17
18
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 ------------------------------------------------------------------------------
26
*/
27
28
/**
29
 * TestSuite Definition
30
 */
31
var testsuite = {
32
    code  : "./dist/joii.js",
33
    tests : [
34
         // PrototypeBuilder
35
             "./test/PrototypeBuilder/DeepCopyTest.js",
36
             "./test/PrototypeBuilder/InheritanceTest.js",
37
             "./test/PrototypeBuilder/PropertyMetaTest.js",
38
             "./test/PrototypeBuilder/TraitTest.js",
39
         // ClassBuilder
40
             "./test/ClassBuilder/InstantiationTest.js",
41
             "./test/ClassBuilder/InheritanceTest.js",
42
             "./test/ClassBuilder/AbstractImplementationTest.js",
43
             "./test/ClassBuilder/VisibilityTest.js",
44
             "./test/ClassBuilder/GetterTest.js",
45
             "./test/ClassBuilder/SetterValidationTest.js",
46
             "./test/ClassBuilder/NullableTypeTest.js",
47
             "./test/ClassBuilder/TypeValidationTest.js",
48
             "./test/ClassBuilder/InstanceOfTest.js",
49
             "./test/ClassBuilder/CallTest.js",
50
             "./test/ClassBuilder/ConstantTest.js",
51
             "./test/ClassBuilder/SerializeTest.js",
52
         // InterfaceBuilder,
53
             "./test/InterfaceBuilder/InterfaceBuilderTest.js",
54
             "./test/InterfaceBuilder/InterfaceValidationTest.js",
55
         // EnumBuilder
56
             "./test/EnumBuilder/EnumBuilderTest.js",
57
         // Reflection
58
             "./test/Reflection/ReflectionTest.js",
59
         // GitHub Reported Issues
60
             "./test/IssueReports/IssueReport4.js",
61
             "./test/IssueReports/IssueReport9.js",
62
             "./test/IssueReports/IssueReport10.js",
63
             "./test/IssueReports/IssueReport11.js",
64
             "./test/IssueReports/IssueReport15.js",
65
             "./test/IssueReports/IssueReport16.js",
66
             "./test/IssueReports/IssueReport19.js",
67
             "./test/IssueReports/IssueReport21.js"
68
    ]
69
};
70
71
/**
72
 * Platform-independent bootstrap.
73
 */
74
if (typeof(window) === 'undefined') {
75
    // Are we running on CLI / NodeJS ?
76
    var qunit = require("qunit");
77
    qunit.run(testsuite);
78
} else {
79
    // We're running a browser.
80
    var addScript = function(file) {
81
        var s = document.createElement('script');
0 ignored issues
show
This function should enable strict mode with use strict.

Strict mode is a way to opt-in to a restricted variant of JavaScript. It eliminates some common pitfalls by being less lenient and raising more errors.

Besides, it is also used to fix certain mistakes which made it difficult for JavaScript runtimes to perform certain optimizations.

We generally recommend to only enable strict mode on the function scope and not in the global scope as that might break third-party scripts on your website.

Loading history...
82
        s.setAttribute('type', 'text/javascript');
83
        s.setAttribute('src', file);
84
        document.getElementsByTagName('head')[0].appendChild(s);
85
    };
86
    addScript(testsuite.code);
87
    for (var i in testsuite.tests) {
88
        addScript(testsuite.tests[i]);
89
    }
90
}
91