DEV Community

Discussion on: Setup Continuous Integration with Travis CI in Your Nodejs App

Collapse
 
baystef profile image
Baystef

Hello, thanks for the great post, but I have a question. On the index.spec.js file you imported the server file i.e
const server = require('../index');
but it appears 'server' wasn't used anywhere. Why did you import it please and can it be omitted since it's not used. Thanks

Collapse
 
nwa_eneh profile image
Tony

She didn't use server variable because she was just writing a demo test case, comparing two identical strings (which would definitely always pass)

expect('ci with travis').to.equal('ci with travis')

In the real world she'd rather be doing something in the lines of inspecting that server variable to see if server was actually successfully created at specified port.