mirror of
https://github.com/ilyakooo0/purescript-indexedDB.git
synced 2024-10-26 08:02:39 +03:00
remove Test.Spec.Mocha from src and add it as an external dependency
This commit is contained in:
parent
9ab34a7d7b
commit
564ff75c8e
13
bower.json
13
bower.json
@ -25,13 +25,14 @@
|
||||
"url": "git://github.com/KtorZ/purescript-ifrit.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"purescript-maybe": "3.0.0",
|
||||
"purescript-aff": "3.1.0",
|
||||
"purescript-datetime": "3.2.0"
|
||||
"purescript-maybe": "^3.0.0",
|
||||
"purescript-aff": "^3.1.0",
|
||||
"purescript-datetime": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"purescript-spec": "1.0.0",
|
||||
"purescript-psci-support": "3.0.0",
|
||||
"purescript-now": "3.0.0"
|
||||
"purescript-spec": "^1.0.0",
|
||||
"purescript-psci-support": "^3.0.0",
|
||||
"purescript-now": "^3.0.0",
|
||||
"purescript-spec-mocha": "https://github.com/truqu/purescript-spec-mocha.git#0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
/* global exports, it */
|
||||
|
||||
// module Test.Spec.Mocha
|
||||
|
||||
if (typeof describe !== 'function' || typeof it !== 'function') {
|
||||
throw new Error('Mocha globals seem to be unavailable!');
|
||||
}
|
||||
|
||||
exports.itAsync = function (only) {
|
||||
"use strict";
|
||||
return function (name) {
|
||||
return function (aff) {
|
||||
return function () {
|
||||
var f = only ? it.only : it;
|
||||
f(name, function (done) {
|
||||
aff(function () {
|
||||
done();
|
||||
}, function (err) {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
exports.itPending = function (name) {
|
||||
"use strict";
|
||||
return function () {
|
||||
it(name);
|
||||
};
|
||||
};
|
||||
|
||||
exports.describe = function (only) {
|
||||
"use strict";
|
||||
return function (name) {
|
||||
return function (nested) {
|
||||
return function () {
|
||||
var f = only ? describe.only : describe;
|
||||
f(name, function () {
|
||||
nested();
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,41 +0,0 @@
|
||||
module Test.Spec.Mocha (
|
||||
runMocha,
|
||||
MOCHA()
|
||||
) where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Control.Monad.Aff (Aff())
|
||||
import Control.Monad.Eff (kind Effect, Eff())
|
||||
|
||||
import Data.Foldable (traverse_)
|
||||
|
||||
import Test.Spec (Spec, Group(..), collect)
|
||||
|
||||
foreign import data MOCHA :: Effect
|
||||
|
||||
foreign import itAsync :: forall e.
|
||||
Boolean
|
||||
-> String
|
||||
-> Aff e Unit
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
|
||||
foreign import itPending :: forall e. String
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
|
||||
foreign import describe :: forall e.
|
||||
Boolean
|
||||
-> String
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
|
||||
registerGroup :: forall e. (Group (Aff e Unit))
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
registerGroup (It only name test) = itAsync only name test
|
||||
registerGroup (Pending name) = itPending name
|
||||
registerGroup (Describe only name groups) =
|
||||
describe only name (traverse_ registerGroup groups)
|
||||
|
||||
runMocha :: forall e. Spec e Unit
|
||||
-> Eff (mocha :: MOCHA | e) Unit
|
||||
runMocha spec = traverse_ registerGroup (collect spec)
|
Loading…
Reference in New Issue
Block a user