commit
15411e8b89
17 changed files with 38 additions and 5 deletions
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,7 @@ |
||||
module.exports = { |
||||
postData: [ |
||||
{ title: 'A walk in the park' }, |
||||
{ title: 'Down the road', author: 'Alice' }, |
||||
{ title: 'On a summer day', author: 'Bob' }, |
||||
], |
||||
} |
@ -0,0 +1,25 @@ |
||||
const assert = require('chai').assert |
||||
const remote = require('../src/remote') |
||||
|
||||
describe('remote', () => { |
||||
const data = remote.postData |
||||
|
||||
describe('postData', () => { |
||||
it('should return an array', () => { |
||||
assert.typeOf(data, 'array') |
||||
}) |
||||
it('should not be empty', () => { |
||||
assert.isAtLeast(data.length, 1) |
||||
}) |
||||
it('should contain objects', () => { |
||||
for (obj of data) { |
||||
assert.typeOf(obj, 'object') |
||||
} |
||||
}) |
||||
it('should have objects with properties', () => { |
||||
for (obj of data) { |
||||
assert.isAtLeast(Object.keys(obj).length, 1) |
||||
} |
||||
}) |
||||
}) |
||||
}) |
Loading…
Reference in new issue