Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

only run non-qSA tests in non-qSA environment

  • Loading branch information...
commit 403a3dc6964821e96abefe8e35d33986b901b790 1 parent 08636b3
@rvagg rvagg authored
Showing with 12 additions and 13 deletions.
  1. +12 −13 tests/tests.js
View
25 tests/tests.js
@@ -1,17 +1,16 @@
-
-// custom pseudo just for tests
+// silly custom pseudo just for tests
Q.pseudos.humanoid = function(e, v) { return Q.is(e, 'li:contains(human)') || Q.is(e, 'ol:contains(human)') }
-
-function sinkSuite(label, suite) {
- sink(label + ' [qSA]', function () {
- Q.configure({ 'NATIVE_QSA': true })
- suite.apply(null, arguments)
- })
- sink(label + ' [non-QSA]', function () {
- Q.configure({ 'NATIVE_QSA': false })
- suite.apply(null, arguments)
- })
-}
+var hasQSA = !!document.querySelectorAll
+ , sinkSuite = function (label, suite) {
+ sink(label + (hasQSA ? ' [qSA]' : ''), function () {
+ hasQSA && Q.configure({ 'NATIVE_QSA': true })
+ suite.apply(null, arguments)
+ })
+ hasQSA && sink(label + ' [non-QSA]', function () {
+ Q.configure({ 'NATIVE_QSA': false })
+ suite.apply(null, arguments)
+ })
+ }
sinkSuite('Contexts', function (test, ok) {
Please sign in to comment.
Something went wrong with that request. Please try again.