MCPcopy Create free account
hub / github.com/ampproject/amphtml / overrideSkipTest

Function overrideSkipTest

testing/init-tests-helpers.js:105–113  ·  view source on GitHub ↗

* Overrides skipTest() with a more robust version of `this.skip()`. See #17245.

()

Source from the content-addressed store, hash-verified

103 * Overrides skipTest() with a more robust version of `this.skip()`. See #17245.
104 */
105function overrideSkipTest() {
106 this.skipTest = function () {
107 if (!this._runnable.title.startsWith('"before all" hook')) {
108 throw new Error('skipTest() can only be called from within before()');
109 }
110 this.test.parent.pending = true; // Workaround for mochajs/mocha#2683.
111 this.skip();
112 };
113}
114
115/**
116 * Sets up the initial state required by individual test cases.

Callers

nothing calls this directly

Calls 1

skipMethod · 0.80

Tested by

no test coverage detected