forked from kenny-y/wn-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-mocha-test.js
57 lines (42 loc) · 1.41 KB
/
simple-mocha-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"use strict"
const addon = require('bindings')('exampleAddon');
const assert = require("assert");
beforeEach(() => {
});
afterEach(() => {
});
describe('Meal API Test', function () {
describe('API Existance', function() {
it('addon.Meal is a function', function() {
assert.equal(typeof addon.Meal, 'function');
});
it('new addon.Meal() returns an object ', function () {
var x = new addon.Meal();
assert.equal(typeof x, 'object');
});
it('new addon.Meal() object has boolean attribute .isRawMeal', function () {
var x = new addon.Meal();
assert.equal(typeof x.isRawMeal, 'boolean');
});
it('new addon.Meal() object has number attribute .size', function () {
var x = new addon.Meal();
assert.equal(typeof x.size, 'number');
x.size = 3.14;
assert.equal(x.size, 3.14);
});
it('new addon.Meal() object has string attribute .type', function () {
var x = new addon.Meal();
assert.equal(typeof x.type, 'string');
x.type = 'string-test-value';
assert.equal(x.type, 'string-test-value');
});
it('new addon.Meal() object has a method .prepare()', function () {
var x = new addon.Meal();
assert.equal(typeof x.prepare, 'function');
});
it('new addon.Meal() object has a method .cook()', function () {
var x = new addon.Meal();
assert.equal(typeof x.cook, 'function');
});
});
});