this.openTestDatabase(function (db) {

        assert.exception(
            db.get.bind(db)
          , { name: 'ReadError', message: 'get() requires key and callback arguments' }
          , 'no-arg get() throws'
        )

        assert.exception(
            db.get.bind(db, 'foo')
          , { name: 'ReadError', message: 'get() requires key and callback arguments' }
          , 'callback-less, 1-arg get() throws'
        )

        assert.exception(
            db.get.bind(db, 'foo', {})
          , { name: 'ReadError', message: 'get() requires key and callback arguments' }
          , 'callback-less, 2-arg get() throws'
        )

        done()
      })
Example #2
0
test('routes with duplicate names throw a useful error', () => {
  try {
    router.map((route) => {
      route('foo', () => {
        route('foo')
      })
    })
  } catch (e) {
    assert.equals(e.message, 'Invariant Violation: Route names must be unique, but route "foo" is declared multiple times')
    return
  }
  assert(false, 'Should not reach this')
})
Example #3
0
  Then(/^the resource route is rendered$/, function (done) {
    const $ = cheerio.load(this.getResponseBody());
    const $heading = $('h3');

    assert.equals($heading.length, 1);
    // TODO: this check needs to be more generic so that multiple resource types are handled properly
    // assert.equals(
    //    $heading.text(),
    //    `${this.existingResource['first-name']} ${this.existingResource['last-name']}`
    // );

    done();
  });
Example #4
0
  let m = (transition) => {
    let t = extend({}, transition)
    ;['catch', 'then', 'redirectTo', 'cancel', 'retry', 'followRedirects'].forEach(attr => delete t[attr])
    let et = {
      id: 3,
      prev: {
        routes: [{
          name: 'application',
          path: 'application',
          params: {},
          options: {
            path: 'application'
          }
        }],
        path: '/application',
        pathname: '/application',
        params: {},
        query: {}
      },
      routes: [{
        name: 'application',
        path: 'application',
        params: {},
        options: {
          path: 'application'
        }
      }, {
        name: 'status',
        path: ':user/status/:id',
        params: {
          user: '1',
          id: '2'
        },
        options: {
          path: ':user/status/:id'
        }
      }],
      path: '/application/1/status/2?withReplies=true',
      pathname: '/application/1/status/2',
      params: {
        user: '1',
        id: '2'
      },
      query: {
        withReplies: 'true'
      }
    }
    assert.equals(t, et)

    done()
  }
Example #5
0
test('routes with name "index" or that end int ".index" default to an empty path', () => {
  router.map((route) => {
    route('index')
    route('foo')
    route('bar', () => {
      route('bar.index')
    })
  })
  assert.equals(_.pluck(router.matchers, 'path'), [
    '/',
    '/foo',
    '/bar'
  ])
})
  'chained batch() on pre-opened database': function (done) {
    var location = common.nextLocation()
    // 1) open database without callback, opens in worker thread
    var db = levelup(location, { createIfMissing: true, errorIfExists: true, valueEncoding: 'utf8' })

    this.closeableDatabases.push(db)
    this.cleanupDirs.push(location)
    assert.isObject(db)
    assert.equals(db.location, location)

    // 2) insert 3 values with batch(), these should be deferred until the database is actually open
    db.batch()
      .put('k1', 'v1')
      .put('k2', 'v2')
      .put('k3', 'v3')
      .write(function () {
      // 3) when the callbacks have returned, the database should be open and those values should be in
      //    verify that the values are there
        async.forEach([1, 2, 3], function (k, cb) {
          db.get('k' + k, function (err, v) {
            refute(err)
            assert.equals(v, 'v' + k)
            cb()
          })
        }, function () {
          db.get('k4', function (err) {
            assert(err)
            // DONE
            done()
          })
        })
      })

    // we should still be in a state of limbo down here, not opened or closed, but 'new'
    refute(db.isOpen())
    refute(db.isClosed())
  },
Example #7
0
        , function (err, dir, fileContents, stdout, stderr, callback) {
            refute(err)
            refute(stderr)

            assert.stdoutRefersToNPMPackages(stdout, 'ender-js sel bean dagron')
            assert.stdoutReportsBuildCommand(stdout, 'ender build sel bean dagron')
            assert.stdoutReportsOutputSizes(stdout)
            assert.hasVersionedPackage(stdout, 'sel', 'stdout')
            assert.hasVersionedPackage(stdout, 'es5-basic', 'stdout')
            assert.hasVersionedPackage(stdout, 'bean', 'stdout')
            assert.hasVersionedPackage(stdout, 'dagron', 'stdout')
            assert.hasVersionedPackage(stdout, 'qwery', 'stdout')

            fileContents.forEach(function (contents, i) {
              assert.match(contents, /Build: ender build sel bean dagron$/m, files[i] + ' contains correct build command')
              assert.sourceContainsProvideStatements(contents, 5, files[i])
              assert.hasVersionedPackage(contents, 'sel', files[i])
              assert.hasVersionedPackage(contents, 'es5-basic', files[i])
              assert.hasVersionedPackage(contents, 'bean', files[i])
              assert.hasVersionedPackage(contents, 'dagron', files[i])
              assert.hasVersionedPackage(contents, 'qwery', files[i])
              // sel & es5-basic don't have the standard wrapper pattern
              assert.sourceHasProvide(contents, 'sel', files[i])
              assert.sourceHasProvide(contents, 'es5-basic', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'bean', files[i])
              assert.sourceHasProvide(contents, 'bean', files[i])
              // dagron doesn't have the standard wrapper pattern
              assert.sourceHasProvide(contents, 'dagron', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'qwery', files[i])
              assert.sourceHasProvide(contents, 'qwery', files[i])

              // check they are in order, we only care about the following ordering pairs:
              assert.sourceHasProvidesInOrder(contents, 'es5-basic', 'sel', files[i])
              assert.sourceHasProvidesInOrder(contents, 'bean', 'dagron', files[i])
              assert.sourceHasProvidesInOrder(contents, 'qwery', 'dagron', files[i])
              // check that they are in the order specified on the commandline
              assert.sourceHasProvidesInOrder(contents, 'sel', 'dagron', files[i])

              assert.sourceHasCopyrightComments(contents, 5, files[i]) // head, ender-js, bean, dagron, qwery
            })

            functionalCommon.verifyNodeModulesDirectories(
                dir
              , 'ender-js sel bean dagron'.split(' ')
              , callback.bind(null, done)
            )
        })
Example #8
0
 var verify = function (ws, db) {
   assert.isFalse(ws.writable)
   async.forEach(
       this.sourceData
     , function (data, callback) {
         db.get(data.key, function (err, value) {
           // none of them should exist
           assert(err)
           refute(value)
           callback()
         })
       }
     , done
   )
 }
Example #9
0
                , function (err, dir, fileContents, stdout, stderr, callback) {
                    refute(err)
                    refute(stderr)

                    assert.stdoutRefersToNPMPackages(stdout, 'ender-core ender-commonjs qwery bean')
                    assert.stdoutReportsBuildCommand(stdout, 'ender build qwery bean' + (use ? ' --output ' + use : ''))
                    assert.stdoutReportsOutputSizes(stdout)
                    assert.hasVersionedPackage(stdout, 'qwery', 'stdout')
                    assert.hasVersionedPackage(stdout, 'bean', 'stdout')

                    fileContents.forEach(function (contents, i) {
                      assert.match(
                          contents
                        , new RegExp(
                            'Build: ender build qwery bean' + (use ? ' --output ' + use : '') + '$', 'm'
                          )
                        , files[i] + ' contains correct build command')
                      assert.sourceContainsPackages(contents, 2, files[i])
                      assert.hasVersionedPackage(contents, 'qwery', files[i])
                      assert.hasVersionedPackage(contents, 'bean', files[i])
                      assert.sourceHasPackage(contents, 'qwery', files[i])
                      assert.sourceHasPackage(contents, 'bean', files[i])
                      assert.sourceHasRequire(contents, 'qwery', files[i])
                      assert.sourceHasRequire(contents, 'bean', files[i])
                      assert.sourceHasRequire(contents, 'qwery/src/ender', files[i])
                      assert.sourceHasRequire(contents, 'bean/src/ender', files[i])

                      assert.sourceHasPackagesInOrder(contents, 'qwery', 'bean', files[i])
                    })

                    functionalCommon.verifyNodeModulesDirectories(
                        dir
                      , 'ender-core ender-commonjs qwery bean'.split(' ')
                      , callback.bind(null, done)
                    )
                  }
Example #10
0
        , function (err, dir, fileContents, stdout, stderr, callback) {
            refute(err)
            refute(stderr)

            assert.stdoutRefersToNPMPackages(stdout, 'ender-js jeesh')
            assert.stdoutReportsBuildCommand(stdout, 'ender build jeesh')
            assert.stdoutReportsOutputSizes(stdout)
            assert.hasVersionedPackage(stdout, 'jeesh', 'stdout')
            assert.hasVersionedPackage(stdout, 'domready', 'stdout')
            assert.hasVersionedPackage(stdout, 'qwery', 'stdout')
            assert.hasVersionedPackage(stdout, 'bonzo', 'stdout')
            assert.hasVersionedPackage(stdout, 'bean', 'stdout')

            fileContents.forEach(function (contents, i) {
              assert.match(contents, /Build: ender build jeesh$/m, files[i] + ' contains correct build command')
              assert.sourceContainsProvideStatements(contents, 5, files[i]) // jeesh has a provide() too
              assert.hasVersionedPackage(contents, 'jeesh', files[i])
              assert.hasVersionedPackage(contents, 'domready', files[i])
              assert.hasVersionedPackage(contents, 'qwery', files[i])
              assert.hasVersionedPackage(contents, 'bonzo', files[i])
              assert.hasVersionedPackage(contents, 'bean', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'domready', files[i])
              assert.sourceHasProvide(contents, 'domready', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'qwery', files[i])
              assert.sourceHasProvide(contents, 'qwery', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'bonzo', files[i])
              assert.sourceHasProvide(contents, 'bonzo', files[i])
              assert.sourceHasStandardWrapFunction(contents, 'bean', files[i])
              assert.sourceHasProvide(contents, 'bean', files[i])

              // check they are in order, we only care about the following ordering pairs:
              // (take advantage of the useless jeesh provide() to make sure it's last)
              assert.sourceHasProvidesInOrder(contents, 'domready', 'jeesh', files[i])
              assert.sourceHasProvidesInOrder(contents, 'qwery', 'jeesh', files[i])
              assert.sourceHasProvidesInOrder(contents, 'bonzo', 'jeesh', files[i])
              assert.sourceHasProvidesInOrder(contents, 'bean', 'jeesh', files[i])

              assert.sourceHasCopyrightComments(contents, 6, files[i]) // 1 each + header
            })

            functionalCommon.verifyNodeModulesDirectories(
                dir
              , 'ender-js jeesh'.split(' ')
              , callback.bind(null, done)
            )
        })
Example #11
0
   requireSubvert.require('../lib/minify').minify(parsedArgs, sourceArg, function (err, result) {
   refute(err)
   assert.same(result, resultArg)
   assert.equals(enderMinifyStub.callCount, 1)
   assert.equals(enderMinifyStub.getCall(0).args.length, 4)
   assert.equals(enderMinifyStub.getCall(0).args[0], minifier)
   assert.same(enderMinifyStub.getCall(0).args[1], sourceArg)
   assert.equals(enderMinifyStub.getCall(0).args[2], expectedOptions)
   done()
 }.bind(this))
Example #12
0
  router.use((transition) => {
    assert.equals(transition.routes[0].name, 'application')
    assert.equals(transition.routes[0].foo, 1)
    assert.equals(transition.routes[0].options.bar, 2)

    assert.equals(router.routes[0].name, 'application')
    assert.equals(router.routes[0].foo, undefined)
    assert.equals(router.routes[0].options.foo, undefined)
    done()
  })
function assertRequireThrows (module) {
  var levelup = require('..')
  var error = 'Wow, this is kind of evil isn\'t it?'
  // simulate an exception from a require() that doesn't resolved a package
  Object.defineProperty(require.cache, require.resolve(module), {
    get: function () {
      throw new Error(error)
    }
  })
  assert.exception(levelup.bind(null, '/foo/bar'), function (err) {
    if (err.name !== 'LevelUPError') { return false }
    var template = 'Failed to require LevelDOWN (%s). Try `npm install leveldown` if it\'s missing'
    if (format(template, error) !== err.message) { return false }
    return true
  })
}
Example #14
0
 'constructor with only function argument uses factory': function (done) {
   var db = levelup(MemDOWN)
   assert.isNull(db.location, 'location property is null')
   db.on('open', function () {
     assert(db.db instanceof MemDOWN, 'using a memdown backend')
     assert.same(db.db.location, '', 'db location property is ""')
     db.put('foo', 'bar', function (err) {
       refute(err, 'no error')
       db.get('foo', function (err, value) {
         refute(err, 'no error')
         assert.equals(value, 'bar', 'correct value')
         done()
       })
     })
   })
 }
Example #15
0
    it('should call all ONLY subscribers of the published message', function(){
        var message1 = TestHelper.getUniqueString(),
            message2 = TestHelper.getUniqueString(),
            spy1 = sinon.spy(),
            spy2 = sinon.spy();

        PubSub.subscribe( message1, spy1 );
        PubSub.subscribe( message2, spy2 );

        PubSub.publishSync( message1, 'some payload' );

        // ensure the first subscriber IS called
        assert(	 spy1.called );
        // ensure the second subscriber IS NOT called
        assert.equals( spy2.callCount, 0 );
    });
Example #16
0
    levelup(this.cleanupDirs[0] = common.nextLocation(), { createIfMissing: true }, function (err, db) {
      refute(err) // sanity
      this.closeableDatabases.push(db)
      assert.isTrue(db.isOpen())

      db.close(function () {
        assert.isFalse(db.isOpen())

        levelup(this.cleanupDirs[0], { errorIfExists: false }, function (err, db) {
          refute(err)
          this.closeableDatabases.push(db)
          assert.isTrue(db.isOpen())
          done()
        }.bind(this))
      }.bind(this))
    }.bind(this))
 , 'test no leveldown': function () {
     var levelup = require('..')
     // simulate an exception from a require() that doesn't resolved a package
     Object.defineProperty(require.cache, require.resolve('leveldown'), {
       get: function() {
         throw new Error('Wow, this is kind of evil isn\'t it?')
       }
     })
     assert.exception(levelup.bind(null, '/foo/bar'), function (err) {
       if (err.name != 'LevelUPError')
         return false
       if ('Could not locate LevelDOWN, try `npm install leveldown`' != err.message)
         return false
       return true
     })
   }
Example #18
0
        levelup(location, function (err, db) { // no options object
          refute(err)
          assert.isObject(db)
          assert.isTrue(db.options.createIfMissing)
          assert.isFalse(db.options.errorIfExists)
          assert.equals(db.options.keyEncoding, 'utf8')
          assert.equals(db.options.valueEncoding, 'utf8')
          assert.equals(db.location, location)

            // read-only properties
          db.location = 'foo'
          assert.equals(db.location, location)

          done()
        })
Example #19
0
 test('custom link intercept click handler', async function () {
   let interceptCalledWith = false
   router.options.pushState = true
   router.options.interceptLinks = function (event, link) {
     event.preventDefault()
     interceptCalledWith = link.getAttribute('href')
   }
   router.map(routes)
   await router.listen('foobar')
   let a = document.createElement('a')
   a.href = '/hello/world'
   a.innerHTML = 'hello'
   document.body.appendChild(a)
   mouse.click(a)
   assert.equals(interceptCalledWith, '/hello/world')
   document.body.removeChild(a)
 })
 fs.readdir(tmpDir, function (err, files) {
   if (err) {
     assert.fail('couldn\'t list files in temp dir: ' + tmpDir)
     done()
   } else {
     execute(function () {
       fs.readdir(tmpDir, function (err, files2) {
         if (err) {
           assert.fail('couldn\'t list files in temp dir: ' + tmpDir)
           done()
         } else {
           verify(files, files2)
           done()
         }
       })
     })
   }
 })
Example #21
0
test('#isActive returns true if arguments match current state and false if not', async () => {
  router.map(routes)
  await router.listen()
  await router.transitionTo('notifications')
  assert.equals(router.isActive('notifications'), true)
  assert.equals(router.isActive('messages'), false)
  await router.transitionTo('status', {user: 'me', id: 1})
  assert.equals(router.isActive('status', {user: 'me'}), true)
  assert.equals(router.isActive('status', {user: 'notme'}), false)
  await router.transitionTo('messages', null, {foo: 'bar'})
  assert.equals(router.isActive('messages', null, {foo: 'bar'}), true)
  assert.equals(router.isActive('messages', null, {foo: 'baz'}), false)
})
Example #22
0
                , function (err, dir, fileContents, stdout, stderr, callback) {
                    refute(err)
                    refute(stderr)

                    assert.stdoutRefersToNPMPackages(stdout, 'ender-js qwery bean bonzo sel')
                    assert.stdoutReportsBuildCommand(stdout, 'ender build qwery bean bonzo sel' + (use ? ' --output ' + use : ''))
                    assert.stdoutReportsOutputSizes(stdout)
                    assert.hasVersionedPackage(stdout, 'qwery', 'stdout')
                    assert.hasVersionedPackage(stdout, 'bean', 'stdout')
                    assert.hasVersionedPackage(stdout, 'bonzo', 'stdout')
                    assert.hasVersionedPackage(stdout, 'sel', 'stdout')

                    fileContents.forEach(function (contents, i) {
                      assert.match(
                          contents
                        , new RegExp('Build: ender build qwery bean bonzo sel' + (use ? ' --output ' + use : '') + '$', 'm')
                        , files[i] + ' contains correct build command'
                      )
                      assert.sourceContainsProvideStatements(contents, 5, files[i])
                      assert.hasVersionedPackage(contents, 'qwery', files[i])
                      assert.hasVersionedPackage(contents, 'bean', files[i])
                      assert.hasVersionedPackage(stdout, 'bonzo', 'stdout')
                      assert.hasVersionedPackage(stdout, 'es5-basic', 'stdout')
                      assert.hasVersionedPackage(stdout, 'sel', 'stdout')
                      assert.sourceHasStandardWrapFunction(contents, 'qwery', files[i])
                      assert.sourceHasProvide(contents, 'qwery', files[i])
                      assert.sourceHasStandardWrapFunction(contents, 'bean', files[i])
                      assert.sourceHasProvide(contents, 'bean', files[i])
                      assert.sourceHasStandardWrapFunction(contents, 'bonzo', files[i])
                      assert.sourceHasProvide(contents, 'bonzo', files[i])
                      assert.sourceHasProvide(contents, 'es5-basic', files[i])
                      assert.sourceHasProvide(contents, 'sel', files[i])

                      assert.sourceHasProvidesInOrder(contents, 'qwery', 'bean', files[i])
                      assert.sourceHasProvidesInOrder(contents, 'bean', 'bonzo', files[i])
                      assert.sourceHasProvidesInOrder(contents, 'bonzo', 'es5-basic', files[i])
                      assert.sourceHasProvidesInOrder(contents, 'es5-basic', 'sel', files[i])
                    })

                    functionalCommon.verifyNodeModulesDirectories(
                        dir
                      , 'ender-js qwery bean bonzo sel'.split(' ')
                      , callback.bind(null, done)
                    )
                  }
Example #23
0
      { createIfMissing: true, errorIfExists: true, keyEncoding: 'ascii', valueEncoding: 'json' }, function (err, db) {
        refute(err)

        this.closeableDatabases.push(db)
        this.cleanupDirs.push(location)
        assert.isObject(db)
        assert.isTrue(db.options.createIfMissing)
        assert.isTrue(db.options.errorIfExists)
        assert.equals(db.options.keyEncoding, 'ascii')
        assert.equals(db.options.valueEncoding, 'json')
        assert.equals(db.location, location)

        // read-only properties
        db.location = 'bar'
        assert.equals(db.location, location)

        done()
      }.bind(this)
Example #24
0
    it('should fail immediately on exceptions in namespaces when immediateExceptions is true',  function(){
        var func1 = function(){
                throw('some error');
            },
            spy1 = sinon.spy();

        PubSub.subscribe( 'buy', func1 );
        PubSub.subscribe( 'buy', spy1 );

        PubSub.immediateExceptions = true;

        assert.exception( function(){
            PubSub.publishSync( 'buy.tomatoes', 'some data' );
        });

        refute( spy1.called );

        // make sure we restore PubSub to it's original state
        delete PubSub.immediateExceptions;
    });
Example #25
0
                it("matches maps containing the given elements", function () {
                    var mapOne = new Map();
                    mapOne.set("one", 1);
                    mapOne.set("two", 2);
                    mapOne.set("three", 3);

                    var mapTwo = new Map();
                    mapTwo.set("one", 1);
                    mapTwo.set("two", 2);
                    mapTwo.set("three", 3);

                    var mapThree = new Map();
                    mapThree.set("one", 1);
                    mapThree.set("two", 2);

                    var mapFour = new Map();
                    mapFour.set("one", 1);
                    mapFour.set("four", 4);

                    assert(sinonMatch.map.contains(mapTwo).test(mapOne));
                    assert(sinonMatch.map.contains(mapThree).test(mapOne));
                    assert.isFalse(sinonMatch.map.contains(mapFour).test(mapOne));
                });
Example #26
0
                it("matches sets containing the given elements", function () {
                    var setOne = new Set();
                    setOne.add("one");
                    setOne.add("two");
                    setOne.add("three");

                    var setTwo = new Set();
                    setTwo.add("one");
                    setTwo.add("two");
                    setTwo.add("three");

                    var setThree = new Set();
                    setThree.add("one");
                    setThree.add("two");

                    var setFour = new Set();
                    setFour.add("one");
                    setFour.add("four");

                    assert(sinonMatch.set.contains(setTwo).test(setOne));
                    assert(sinonMatch.set.contains(setThree).test(setOne));
                    assert.isFalse(sinonMatch.set.contains(setFour).test(setOne));
                });
Example #27
0
    it('should fail immediately on exceptions when immediateExceptions is true', function(){
        var message = TestHelper.getUniqueString(),
            func1 = function(){
                throw('some error');
            },
            spy1 = sinon.spy(),
            spy2 = sinon.spy();


        PubSub.subscribe( message, func1 );
        PubSub.subscribe( message, spy1 );

        PubSub.immediateExceptions = true;

        assert.exception( function(){
            PubSub.publishSync( message, 'some data' );
        });

        refute( spy1.called );
        refute( spy2.called );

        // make sure we restore PubSub to it's original state
        delete PubSub.immediateExceptions;
    });
Example #28
0
    it('should call all subscribers, even if there are exceptions', function( done ){
        var message = TestHelper.getUniqueString(),
            func1 = function(){
                throw('some error');
            },
            spy1 = sinon.spy(),
            spy2 = sinon.spy(),
            clock = sinon.useFakeTimers();

        PubSub.subscribe( message, func1 );
        PubSub.subscribe( message, spy1 );
        PubSub.subscribe( message, spy2 );

        assert.exception( function(){
            PubSub.publishSync( message, 'some data' );
            clock.tick(1);
        });

        assert( spy1.called );
        assert( spy2.called );

        done();
        clock.restore();
    });
Example #29
0
                    fileContents.forEach(function (contents, i) {
                      assert.match(
                          contents
                        , new RegExp(
                            'Build: ender build qwery bean bonzo sel' + (use ? ' --output ' + use : '') + '$', 'm'
                          )
                        , files[i] + ' contains correct build command')
                      assert.sourceContainsPackages(contents, 5, files[i])
                      assert.hasVersionedPackage(contents, 'qwery', files[i])
                      assert.hasVersionedPackage(contents, 'bean', files[i])
                      assert.hasVersionedPackage(stdout, 'bonzo', 'stdout')
                      assert.hasVersionedPackage(stdout, 'es5-basic', 'stdout')
                      assert.hasVersionedPackage(stdout, 'sel', 'stdout')
                      assert.sourceHasPackage(contents, 'qwery', files[i])
                      assert.sourceHasPackage(contents, 'bean', files[i])
                      assert.sourceHasPackage(contents, 'bonzo', files[i])
                      assert.sourceHasPackage(contents, 'es5-basic', files[i])
                      assert.sourceHasPackage(contents, 'sel', files[i])
                      assert.sourceHasRequire(contents, 'qwery', files[i])
                      assert.sourceHasRequire(contents, 'bean', files[i])
                      assert.sourceHasRequire(contents, 'bonzo', files[i])
                      assert.sourceHasRequire(contents, 'es5-basic', files[i])
                      assert.sourceHasRequire(contents, 'sel', files[i])
                      assert.sourceHasRequire(contents, 'qwery/src/ender', files[i])
                      assert.sourceHasRequire(contents, 'bean/src/ender', files[i])
                      assert.sourceHasRequire(contents, 'bonzo/src/ender', files[i])
                      assert.sourceHasRequire(contents, 'sel/lib/ender', files[i])

                      assert.sourceHasPackagesInOrder(contents, 'qwery', 'bean', files[i])
                      assert.sourceHasPackagesInOrder(contents, 'bean', 'bonzo', files[i])
                      assert.sourceHasPackagesInOrder(contents, 'bonzo', 'es5-basic', files[i])
                      assert.sourceHasPackagesInOrder(contents, 'es5-basic', 'sel', files[i])
                    })
Example #30
0
  Then(/^a "([^"]*)" status code should be returned$/, function (statusCode, done) {
    assert.equals(this.serverResponse.statusCode, parseInt(statusCode, 10));

    done();
  });