-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
* make global.testdouble, global.lodash * requireSubject no longer calls require, just reduces on the testdouble global (only required a change to one line of all the test code), all passing
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
global.testdouble = require('./../lib/testdouble') | ||
global._ = require('lodash') | ||
global.expect = require('chai').expect | ||
|
||
# Stuff to pull into the common-helper | ||
global.context = describe | ||
global.requireSubject = (path) -> require("#{process.cwd()}/#{path}") | ||
global.requireSubject = (path) -> | ||
return testdouble unless path? | ||
This comment has been minimized.
Sorry, something went wrong.
jasonkarns
Member
|
||
[lib, pathComponents...] = path.split('/') | ||
_.reduce pathComponents, (memo, nextProp) -> | ||
console.log "HEYY", testdouble, "memo:", memo, "next:", nextProp | ||
memo[nextProp] | ||
, testdouble | ||
|
||
global.xThen = -> | ||
|
||
|
should we just have the node-helper
require
the general helper?