Handle common test runner stuff in test/runner/index.js

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Native, Testing
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are a bunch of things we tend to do a lot for our tests that could be combined into a single location at test/runner/index.js.

      Items that come to mind are:

      • Creating a sinon sandbox that resets after each test
      • Using certain chai plugins like chai-subset.
      • Setting certain chai config flags

      Something like the following would be nice:

      
      const chai = require('chai');
      chai.use(require('chai-subset'));
      chai.config.includeStack = true;
      chai.config.showDiff = true;
      chai.config.truncateThreshold = 0;
      
      before(function() {
        this.sinon = sinon.sandbox.create();
      
        // not sure about this one, but it could be useful to avoid pulling in expect at the top of each file.
        this.expect = chai.expect;
      });
      
      afterEach(function() {
        this.sinon.restore();
      });
      

              Assignee:
              Unassigned
              Reporter:
              Daniel Aprahamian (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: