Skip to content

Commit

Permalink
WIP: Refactoring & simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
justsml committed Apr 8, 2018
1 parent 250d973 commit 15e89fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "escape-from-callback-mountain",
"version": "1.5.1",
"version": "2.0.0",
"description": "A Modern Guide to Functional Promises w/ many examples",
"main": "src/auth.js",
"directories": {
"example": "examples",
"src": "src"
},
"scripts": {
"test": "jscs src && NODE_ENV=production ava --verbose --serial",
"test": "jscs src && NODE_ENV=production ava --verbose --serial src/auth.test.js",
"start": "npm install && docker-compose -p task-queue up --build",
"postinstall": "cd examples/distributed-http-task-queue && npm install"
},
Expand Down
30 changes: 15 additions & 15 deletions src/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ test.before('create user records', t => {
})
})

test.cb('callback: login successful', t => {
t.plan(2)
const {auth} = require('./auth.callbacks')
return auth('alice', 'superSecret1', (err, result) => {
console.log('err:', err, '\nresult:', result, '\n')
t.is(result.username, 'alice')
t.falsy(err)
t.end()
})
})
// test.cb('callback: login successful', t => {
// t.plan(2)
// const {auth} = require('./auth.callbacks')
// return auth('alice', 'superSecret1', (err, result) => {
// console.log('err:', err, '\nresult:', result, '\n')
// t.is(result.username, 'alice')
// t.falsy(err)
// t.end()
// })
// })

test.cb('callback: login failed', t => {
t.plan(1)
const {auth} = require('./auth.callbacks')
auth('eve', 'fooBar', (err, result) => t.truthy(err) || t.end())
})
// test.cb('callback: login failed', t => {
// t.plan(1)
// const {auth} = require('./auth.callbacks')
// auth('eve', 'fooBar', (err, result) => t.truthy(err) || t.end())
// })

test('fp/river: login successful', t => {
t.plan(2)
Expand Down

0 comments on commit 15e89fc

Please sign in to comment.