-
Notifications
You must be signed in to change notification settings - Fork 16
fixed the test #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fixed the test #20
Conversation
index.js
Outdated
|
||
const greet = ('./lib/greet.js'); | ||
|
||
greet.sayHi('sugey') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a function in your greet.js file so you can't call it here.
index.js
Outdated
@@ -0,0 +1,6 @@ | |||
'use strict' | |||
|
|||
const greet = ('./lib/greet.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job requiring in your greet.js file.
test/test.js
Outdated
it('should throw a missing name error', function() { | ||
var result = greet.sayHey; | ||
expect(result).to.throw(Error); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good test!
test/test.js
Outdated
it('should return hey sugey!', function() { | ||
var result = greet.sayHey('sugey'); | ||
expect(greet).to.have.property('sayHey'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't testing your function.
test/test.js
Outdated
|
||
describe('#sayBye', function() { | ||
it('should return see ya later!', function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test isn't quite testing anything.
index.js
Outdated
@@ -0,0 +1,6 @@ | |||
'use strict' | |||
|
|||
const greet = require('../lib/greet.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path isn't quite right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its fixed
index.js
Outdated
const greet = require('../lib/greet.js'); | ||
|
||
greet.sayHey(''); | ||
greet.sayBye(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job calling your function from your index.js.
const expect = require('chai').expect; | ||
|
||
describe('Great module', function() { | ||
describe('#sayHey', function(sayHey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to pass in a parameter here.
expect(greet).to.have.property('sayBye'); | ||
expect(result).to.equal('see ya later sugey!'); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with your tests!
all tests work