I'm not sure why it's throwing this error and what exactly it's saying is not a function.
'use strict';
var koa = require("koa");
var app = koa();
var chai = require('chai');
var expect = chai.expect;
var request = require('supertest');
describe('Feature: Car REST Endpoint', function () {
context('Scenario: GET a Car', function () {
var url = 'http://localhost/search/cars';
describe('Given: the resource is accessed at the resource url' + url, function () {
describe('Then: we receive a successful response', function(){
it('status code should be 200', function (done){
request(app)
.get(url)
.expect(200,done);
});
});
it says it's the line .expect(200,done) but I might be wrong.
I also tried this with no luck:
request(app)
.get(url)
.expect(200)
.end(function(err, res){
if (err) return done(err);
done()
});
I also tried var request = require('supertest').agent(koa);