Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const greet = require('./lib/greet.js')

greet.sayHi();
8 changes: 8 additions & 0 deletions lib/greet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports;

exports.sayHi = function(name){
if(arguments.length === 0) throw new Error('no name given')
return `Hi ${name}.`;
};
13 changes: 13 additions & 0 deletions test/greet-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strics';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops there is a typo on this line.


const greet = require('../lib/greet.js');
const assert = require('assert');

describe('Greet Module', function(){
describe('#sayHi', function(){
it('should return Hi noah.', function(){
var result = greet.sayHi('noah');
assert.ok(result ==='Hi noah.', 'result is not Hi noah.')
})
})
})