add promise testing to template
parent
6366815b03
commit
48803ba5fd
|
@ -0,0 +1 @@
|
|||
module.exports = Promise.resolve('some promise hey')
|
|
@ -21,14 +21,15 @@
|
|||
"helpers"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/uCOMmandIt/utilities/issues"
|
||||
"url": "https://github.com/uCOMmandIt/uci-pkg-template/issues"
|
||||
},
|
||||
"homepage": "https://github.com/uCOMmandIt/utilities#readme",
|
||||
"homepage": "https://github.com/uCOMmandIt/uci-pkg-template#readme",
|
||||
"dependencies": {
|
||||
"require-all": "git+https://github.com/dkebler/node-require-all.git#merge"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"chai-as-promised": "^6.0.0",
|
||||
"codecov": "^1.0.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.2.0"
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
'use strict'
|
||||
|
||||
const expect = require('chai').expect,
|
||||
lib = require('../')
|
||||
|
||||
//time-stamp for use when watching to distinguish reruns in console
|
||||
// place in alpha first file only
|
||||
let date = new Date(Date.now())
|
||||
console.log(date.getMinutes(), "\:", date.getSeconds())
|
||||
|
||||
const expect = require('chai').expect,
|
||||
lib = require('../')
|
||||
describe('Test a template module ', function () {
|
||||
|
||||
describe('A template module ', function () {
|
||||
|
||||
it('Should ....', function () {
|
||||
it('Should test all methods', function () {
|
||||
expect(lib.hello('Forest Gump')).to.equal('Hello Forest Gump')
|
||||
})
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
'use strict'
|
||||
|
||||
const chai = require('chai'),
|
||||
chaiAsPromised = require("chai-as-promised"),
|
||||
lib = require('../')
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
describe('Promise Stuff - ', function () {
|
||||
|
||||
it('Can test a promise', function () {
|
||||
|
||||
return expect(lib.apromise).to.eventually.equal('some promise hey')
|
||||
return Promise.resolve().then(() => expect(lib.apromise).to.eventually.equal('some promise hey'))
|
||||
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue