Skip to content

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.

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

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