MCPcopy
hub / github.com/playcanvas/engine / validTest

Function validTest

tests/qunit/qunit.js:1165–1201  ·  view source on GitHub ↗

@return Boolean: true if this test should be ran

( test )

Source from the content-addressed store, hash-verified

1163
1164/** @return Boolean: true if this test should be ran */
1165function validTest( test ) {
1166 var include,
1167 filter = config.filter && config.filter.toLowerCase(),
1168 module = config.module && config.module.toLowerCase(),
1169 fullName = (test.module + ": " + test.testName).toLowerCase();
1170
1171 // Internally-generated tests are always valid
1172 if ( test.callback && test.callback.validTest === validTest ) {
1173 delete test.callback.validTest;
1174 return true;
1175 }
1176
1177 if ( config.testNumber ) {
1178 return test.testNumber === config.testNumber;
1179 }
1180
1181 if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) {
1182 return false;
1183 }
1184
1185 if ( !filter ) {
1186 return true;
1187 }
1188
1189 include = filter.charAt( 0 ) !== "!";
1190 if ( !include ) {
1191 filter = filter.slice( 1 );
1192 }
1193
1194 // If the filter matches, we need to honour include
1195 if ( fullName.indexOf( filter ) !== -1 ) {
1196 return include;
1197 }
1198
1199 // Otherwise, do the opposite
1200 return !include;
1201}
1202
1203// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions)
1204// Later Safari and IE10 are supposed to support error.stack as well

Callers 1

qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected