Update it all, VisualStudio Changes
This commit is contained in:
9
javascript/example/example.js
Normal file
9
javascript/example/example.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var Example = function () {
|
||||
'use strict';
|
||||
|
||||
this.add = function (x, y) {
|
||||
return x + y;
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Example;
|
25
javascript/example/example_test.spec.js
Normal file
25
javascript/example/example_test.spec.js
Normal file
@@ -0,0 +1,25 @@
|
||||
var Example = require('./example.js');
|
||||
|
||||
describe("Example", function() {
|
||||
var example = new Example();
|
||||
|
||||
it("add 2 and 2", function () {
|
||||
var result = example.add(2, 2);
|
||||
expect(result).toEqual(4);
|
||||
});
|
||||
|
||||
it("add 12 and 24", function () {
|
||||
var result = example.add(12, 24);
|
||||
expect(result).toEqual(36);
|
||||
});
|
||||
|
||||
it("add 100 and 1", function () {
|
||||
var result = example.add(100, 1);
|
||||
expect(result).toEqual(101);
|
||||
});
|
||||
|
||||
return it("add 2 and -2", function () {
|
||||
var result = example.add(2, -2);
|
||||
expect(result).toEqual(0);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user