Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/searls/james-testdouble-example
https://github.com/searls/james-testdouble-example
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/searls/james-testdouble-example
- Owner: searls
- Created: 2020-05-19T04:35:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T10:37:04.000Z (over 2 years ago)
- Last Synced: 2024-10-27T21:16:35.223Z (3 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Test for James Shore
This is just a throwaway repo in response to [this twitter
thread](https://twitter.com/jamesshore/status/1262591868094701568?s=20)# Usage
```
npm it
```This will install testdouble, teenytest, and ought, then run the tests which are
expected to fail.## Test output
This is the output you should see
```
> [email protected] test /Users/justin/code/searls/james-testdouble-example
> teenytest test.jsTAP version 13
1..6
ok 1 - "doing this with straightforward verifications 0-arg invocation" - test #1 in `test.js`
ok 2 - "doing this with straightforward verifications multi-arg invocation" - test #2 in `test.js`
ok 3 - "doing this with straightforward verifications 1-arg returns rot13 conversion" - test #3 in `test.js`
ok 4 - "doing this with a fake that tracks output 0-arg invocation" - test #4 in `test.js`
not ok 5 - "doing this with a fake that tracks output multi-arg invocation" - test #5 in `test.js`
---
AssertionError [ERR_ASSERTION]: Expected actual to equal expected, but it did not: [
'Too many arguments',
- undefined,
]
at new AssertionError (internal/assert/assertion_error.js:425:11)
at throwError (/Users/justin/code/searls/james-testdouble-example/node_modules/ought/lib/throw-error.js:5:9)
at Object.equal (/Users/justin/code/searls/james-testdouble-example/node_modules/ought/index.js:13:35)
at Object.multi-arg invocation (/Users/justin/code/searls/james-testdouble-example/test.js:73:13)
at /Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/callbackify.js:14:21
at runX (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:22:7)
at Object.userFunction [as wrap] (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/plugins/uncaught-exception.js:16:9)
at callable (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:29:24)
at runX (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:22:7)
at Object.userFunction [as wrap] (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/plugins/results.js:10:9)
...
ok 6 - "doing this with a fake that tracks output 1-arg returns rot13 conversion" - test #6 in `test.js`
# Test run failed!
# Passed: 5
# Failed: 1
# Total: 6
#
# Failures:
#
# 5 - "doing this with a fake that tracks output multi-arg invocation" - test #5 in `test.js`
#
# AssertionError [ERR_ASSERTION]: Expected actual to equal expected, but it did not: [
# 'Too many arguments',
# - undefined,
# ]
# at new AssertionError (internal/assert/assertion_error.js:425:11)
# at throwError (/Users/justin/code/searls/james-testdouble-example/node_modules/ought/lib/throw-error.js:5:9)
# at Object.equal (/Users/justin/code/searls/james-testdouble-example/node_modules/ought/index.js:13:35)
# at Object.multi-arg invocation (/Users/justin/code/searls/james-testdouble-example/test.js:73:13)
# at /Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/callbackify.js:14:21
# at runX (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:22:7)
# at Object.userFunction [as wrap] (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/plugins/uncaught-exception.js:16:9)
# at callable (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:29:24)
# at runX (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/lib/plugins/wrap.js:22:7)
# at Object.userFunction [as wrap] (/Users/justin/code/searls/james-testdouble-example/node_modules/teenytest/plugins/results.js:10:9)
```