Skip to content

Commit

Permalink
Update deps, including example apps
Browse files Browse the repository at this point in the history
  • Loading branch information
searls committed Nov 16, 2022
1 parent 7c96564 commit 6ef85f9
Show file tree
Hide file tree
Showing 35 changed files with 71,538 additions and 19,243 deletions.
11,374 changes: 10,306 additions & 1,068 deletions examples/babel/package-lock.json

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions examples/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"mocha": "^5.0.1",
"semver": "^5.3.0",
"mocha": "^10.1.0",
"testdouble": "file:../.."
},
"standard": {
"globals": [
"td",
"describe",
"beforeEach",
"afterEach",
"it"
]
}
}
7 changes: 0 additions & 7 deletions examples/babel/test/helper.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import td from 'testdouble'
import semver from 'semver'

global.context = describe
global.td = td

const nodeVersion = semver(process.version)
global.NODE_JS = {
AT_LEAST_6: nodeVersion.major >= 6
}

afterEach(() => td.reset())

8 changes: 3 additions & 5 deletions examples/babel/test/lib/calculator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ describe('Calculator', () => {
Multiplier = td.replace('../../lib/multiplier').default
divider = td.replace('../../lib/divider').default
const Calculator = require('../../lib/calculator').default
subject = new Calculator
subject = new Calculator()
})

describe('#calculate', () => {
if (!NODE_JS) return 'module replacement is not supported!'

it('delegates to an Adder', () => {
td.when(Adder.prototype.add(4,9)).thenReturn('yay math!')
td.when(Adder.prototype.add(4, 9)).thenReturn('yay math!')

result = subject.calculate('add', 4, 9)

assert.equal(result, 'yay math!')
})

it('delegates to a Subtractor', () => {
td.when(Subtractor.prototype.subtract(9,8)).thenReturn('minus math!')
td.when(Subtractor.prototype.subtract(9, 8)).thenReturn('minus math!')

result = subject.calculate('subtract', 9, 8)

Expand Down
Loading

0 comments on commit 6ef85f9

Please sign in to comment.