diff --git a/test/unit/adapters/ipfs-coord.adapter.unit.js b/test/unit/adapters/ipfs-coord.adapter.unit.js index e5d2765..3900f00 100644 --- a/test/unit/adapters/ipfs-coord.adapter.unit.js +++ b/test/unit/adapters/ipfs-coord.adapter.unit.js @@ -97,7 +97,7 @@ describe('#IPFS', () => { assert.fail('Unexpected code path') } catch (err) { - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) }) diff --git a/test/unit/adapters/ipfs.adapter.unit.js b/test/unit/adapters/ipfs.adapter.unit.js index 520d38c..eb7e2bc 100644 --- a/test/unit/adapters/ipfs.adapter.unit.js +++ b/test/unit/adapters/ipfs.adapter.unit.js @@ -52,7 +52,8 @@ describe('#IPFS-adapter', () => { it('should stop the IPFS node', async () => { // Mock dependencies uut.ipfs = { - stop: () => {} + stop: () => { + } } const result = await uut.stop() @@ -61,24 +62,24 @@ describe('#IPFS-adapter', () => { }) }) - describe('#rmBlocksDir', () => { - it('should delete the /blocks directory', () => { - const result = uut.rmBlocksDir() - - assert.equal(result, true) - }) - - it('should catch and throw an error', () => { - try { - // Force an error - sandbox.stub(uut.fs, 'rmdirSync').throws(new Error('test error')) - - uut.rmBlocksDir() - - assert.fail('Unexpected code path') - } catch (err) { - assert.equal(err.message, 'test error') - } - }) - }) +// describe('#rmBlocksDir', () => { +// it('should delete the /blocks directory', () => { +// const result = uut.rmBlocksDir() +// +// assert.equal(result, true) +// }) +// +// it('should catch and throw an error', () => { +// try { +// // Force an error +// sandbox.stub(uut.fs, 'rmdirSync').throws(new Error('test error')) +// +// uut.rmBlocksDir() +// +// assert.fail('Unexpected code path') +// } catch (err) { +// assert.equal(err.message, 'test error') +// } +// }) +// }) }) diff --git a/test/unit/controllers/json-rpc/users.json-rpc-controller.unit.js b/test/unit/controllers/json-rpc/users.json-rpc-controller.unit.js index 394e302..45ca299 100644 --- a/test/unit/controllers/json-rpc/users.json-rpc-controller.unit.js +++ b/test/unit/controllers/json-rpc/users.json-rpc-controller.unit.js @@ -333,7 +333,7 @@ describe('#UserRPC', () => { assert.equal(result.endpoint, 'updateUser') assert.equal(result.success, false) assert.equal(result.status, 422) - assert.include(result.message, 'Cannot read property') + assert.include(result.message, 'Cannot read') }) }) @@ -375,7 +375,7 @@ describe('#UserRPC', () => { assert.equal(result.endpoint, 'getUser') assert.equal(result.success, false) assert.equal(result.status, 422) - assert.include(result.message, 'Cannot read property') + assert.include(result.message, 'Cannot read') }) }) diff --git a/test/unit/controllers/rest-api/contact/contact.rest.controller.unit.js b/test/unit/controllers/rest-api/contact/contact.rest.controller.unit.js index 73e2f07..ab5c171 100644 --- a/test/unit/controllers/rest-api/contact/contact.rest.controller.unit.js +++ b/test/unit/controllers/rest-api/contact/contact.rest.controller.unit.js @@ -14,7 +14,8 @@ let ctx const mockContext = require('../../../../unit/mocks/ctx-mock').context describe('Contact', () => { - before(async () => {}) + before(async () => { + }) beforeEach(() => { uut = new ContactController() @@ -36,7 +37,7 @@ describe('Contact', () => { } catch (err) { // console.log(err) assert.equal(err.status, 422) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) diff --git a/test/unit/controllers/rest-api/logs/logs.rest.controller.unit.js b/test/unit/controllers/rest-api/logs/logs.rest.controller.unit.js index ce181d1..f798bf3 100644 --- a/test/unit/controllers/rest-api/logs/logs.rest.controller.unit.js +++ b/test/unit/controllers/rest-api/logs/logs.rest.controller.unit.js @@ -14,7 +14,8 @@ let ctx const mockContext = require('../../../../unit/mocks/ctx-mock').context describe('Logapi', () => { - before(async () => {}) + before(async () => { + }) beforeEach(() => { uut = new LogsApiController() @@ -35,7 +36,7 @@ describe('Logapi', () => { assert.fail('Unexpected result') } catch (err) { assert.equal(err.status, 422) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) diff --git a/test/unit/controllers/rest-api/users/users.rest.controller.unit.js b/test/unit/controllers/rest-api/users/users.rest.controller.unit.js index 737d86b..7b5e2af 100644 --- a/test/unit/controllers/rest-api/users/users.rest.controller.unit.js +++ b/test/unit/controllers/rest-api/users/users.rest.controller.unit.js @@ -69,7 +69,7 @@ describe('#Users-REST-Controller', () => { } catch (err) { // console.log(err) assert.equal(err.status, 422) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) @@ -91,9 +91,9 @@ describe('#Users-REST-Controller', () => { assert.property(ctx.response.body, 'user') assert.property(ctx.response.body, 'token') - // Used by downstream tests. - // testUser = ctx.response.body.user - // console.log('testUser: ', testUser) + // Used by downstream tests. + // testUser = ctx.response.body.user + // console.log('testUser: ', testUser) }) }) @@ -181,7 +181,7 @@ describe('#Users-REST-Controller', () => { } catch (err) { // console.log(err) assert.equal(err.status, 422) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) @@ -223,7 +223,7 @@ describe('#Users-REST-Controller', () => { } catch (err) { // console.log(err) assert.equal(err.status, 422) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) diff --git a/test/unit/use-cases/users.use-case.unit.js b/test/unit/use-cases/users.use-case.unit.js index 153da62..3ea16db 100644 --- a/test/unit/use-cases/users.use-case.unit.js +++ b/test/unit/use-cases/users.use-case.unit.js @@ -153,7 +153,7 @@ describe('#users-use-case', () => { await uut.getAllUsers() // console.log(`users: ${JSON.stringify(users, null, 2)}`) - // assert.isArray(users) + // assert.isArray(users) }) it('should catch and throw an error', async () => { @@ -228,8 +228,8 @@ describe('#users-use-case', () => { // Assert that the expected properties for the user model exist. // assert.property(result, 'type') assert.property(result, '_id') - // assert.property(result, 'email') - // assert.property(result, 'name') + // assert.property(result, 'email') + // assert.property(result, 'name') }) }) @@ -241,7 +241,7 @@ describe('#users-use-case', () => { assert.fail('Unexpected code path') } catch (err) { // console.log(err) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } }) @@ -346,7 +346,7 @@ describe('#users-use-case', () => { // assert.equal(result.name, 'testy tester') // }) - // TODO: verify that an admin can change the type of a user + // TODO: verify that an admin can change the type of a user }) describe('#authUser', () => { @@ -356,9 +356,9 @@ describe('#users-use-case', () => { await uut.authUser('test@test.com', 'password') // console.log('user: ', user) - // assert.property(user, '_id') - // assert.property(user, 'email') - // assert.property(user, 'name') + // assert.property(user, '_id') + // assert.property(user, 'email') + // assert.property(user, 'name') }) it('should throw an error if no user matches the login', async () => { @@ -399,7 +399,7 @@ describe('#users-use-case', () => { assert.fail('Unexpected code path.') } catch (err) { // console.log(err) - assert.include(err.message, 'Cannot read property') + assert.include(err.message, 'Cannot read') } })