Skip to content

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

sueanyv
Copy link

@sueanyv sueanyv commented Feb 20, 2017

all tests work

index.js Outdated

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

greet.sayHi('sugey')
Copy link

@jalleng jalleng Feb 24, 2017

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');
Copy link

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);
});
Copy link

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');

Copy link

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() {

Copy link

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');
Copy link

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.

Copy link
Author

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('');
Copy link

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) {
Copy link

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!');
});
});
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants