<commit_before>import chai from 'chai';
import OrderApi from '../../app/sources/orderApi.js';
import chaiPromises from 'chai-as-promised';
import chaiProperties from 'chai-properties';
import chaiThings from 'chai-things';

chai.should();
//chai.config.truncateThreshold = 0;
chai.use(chaiProperties);
chai.use(chaiThings);
chai.use(chaiPromises);

describe('Order and Flight HTTP Source', () => {

  let order = { orderName: 'what a great order name' };

  it("should create a new order with an ID", 
    (done) => OrderApi.createOrder(order).should.eventually
      .include.a.thing.with.property('id')
      .and.notify(done));

  it("should create a new order with the correct order name", 
    (done) => OrderApi.createOrder(order).should.eventually
      .include.a.thing.with.property('orderName', order.orderName)
      .and.notify(done));

  it("should retreive a list of orders", 
    (done) => OrderApi.getAllOrders().should.eventually
      .all.have.property('id')
      .and.notify(done));

  it("should retreive a single order by id", 
    (done) => OrderApi.getOrder(1).should.eventually
      .have.length(1).and
      .all.have.property('id', 1)
      .and.notify(done));

});<commit_msg>Add source tests for Flights<commit_after>import chai from 'chai';
import OrderApi from '../../app/sources/orderApi.js';
import chaiPromises from 'chai-as-promised';
import chaiProperties from 'chai-properties';
import chaiThings from 'chai-things';

chai.should();
//chai.config.truncateThreshold = 0;
chai.use(chaiProperties);
chai.use(chaiThings);
chai.use(chaiPromises);

describe('Order and Flight HTTP Source', () => {

  let order = { orderName: 'what a great order name' },
      flight = { flightName: 'what a great flight name' };

  it("should create a new order with an ID", 
    (done) => OrderApi.createOrder(order).should.eventually
      .include.a.thing.with.property('id')
      .and.notify(done));

  it("should create a new order with the correct order name", 
    (done) => OrderApi.createOrder(order).should.eventually
      .include.a.thing.with.property('orderName', order.orderName)
      .and.notify(done));

  it("should create a new flight with an associated order",
    (done) => OrderApi.createFlight(flight, 1).should.eventually
      .all.have.properties(flight).and
      .all.have.property('id').and
      .notify(done));

  it("should retreive a list of flights",
    (done) => OrderApi.getAllFlights().should.eventually
      .all.have.property('id').and
      .notify(done));

  it("should retreive a list of orders", 
    (done) => OrderApi.getAllOrders().should.eventually
      .all.have.property('id').and
      .notify(done));

  it("should retreive a single order by id", 
    (done) => OrderApi.getOrder(1).should.eventually
      .have.length(1).and
      .all.have.property('id', 1)
      .and.notify(done));

});
{'fraction_non_alphanumeric': 0.15427574171029668, 'fraction_numerical': 0.0031413612565445027, 'mean_word_length': 3.6375404530744335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6781653', 'n_tokens_mistral': 950, 'n_tokens_neox': 914, 'n_words': 214}