(settings)
| 2890 | var focused$1 = false; |
| 2891 | |
| 2892 | function Test(settings) { |
| 2893 | var i, l; |
| 2894 | |
| 2895 | ++Test.count; |
| 2896 | |
| 2897 | this.expected = null; |
| 2898 | this.assertions = []; |
| 2899 | this.semaphore = 0; |
| 2900 | this.module = config.currentModule; |
| 2901 | this.stack = sourceFromStacktrace(3); |
| 2902 | this.steps = []; |
| 2903 | this.timeout = undefined; |
| 2904 | |
| 2905 | // If a module is skipped, all its tests and the tests of the child suites |
| 2906 | // should be treated as skipped even if they are defined as `only` or `todo`. |
| 2907 | // As for `todo` module, all its tests will be treated as `todo` except for |
| 2908 | // tests defined as `skip` which will be left intact. |
| 2909 | // |
| 2910 | // So, if a test is defined as `todo` and is inside a skipped module, we should |
| 2911 | // then treat that test as if was defined as `skip`. |
| 2912 | if (this.module.skip) { |
| 2913 | settings.skip = true; |
| 2914 | settings.todo = false; |
| 2915 | |
| 2916 | // Skipped tests should be left intact |
| 2917 | } else if (this.module.todo && !settings.skip) { |
| 2918 | settings.todo = true; |
| 2919 | } |
| 2920 | |
| 2921 | extend(this, settings); |
| 2922 | |
| 2923 | this.testReport = new TestReport(settings.testName, this.module.suiteReport, { |
| 2924 | todo: settings.todo, |
| 2925 | skip: settings.skip, |
| 2926 | valid: this.valid() |
| 2927 | }); |
| 2928 | |
| 2929 | // Register unique strings |
| 2930 | for (i = 0, l = this.module.tests; i < l.length; i++) { |
| 2931 | if (this.module.tests[i].name === this.testName) { |
| 2932 | this.testName += " "; |
| 2933 | } |
| 2934 | } |
| 2935 | |
| 2936 | this.testId = generateHash(this.module.name, this.testName); |
| 2937 | |
| 2938 | this.module.tests.push({ |
| 2939 | name: this.testName, |
| 2940 | testId: this.testId, |
| 2941 | skip: !!settings.skip |
| 2942 | }); |
| 2943 | |
| 2944 | if (settings.skip) { |
| 2945 | |
| 2946 | // Skipped tests will fully ignore any sent callback |
| 2947 | this.callback = function () {}; |
| 2948 | this.async = false; |
| 2949 | this.expected = 0; |
nothing calls this directly
no test coverage detected