How to use the ava.skip function in ava

To help you get started, we’ve selected a few ava examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gajus / pianola / test / pianola / parsers / parseExpression.js View on Github external
// eslint-disable-next-line ava/no-skip-test
test.skip('parses an expression (foo \'a b)', (t) => {
  t.deepEqual(parseExpression('foo \'a b'), [
    {
      subroutine: 'foo',
      type: 'SUBROUTINE',
      values: [
        '\'a',
        'b',
      ],
    },
  ]);
});

// eslint-disable-next-line ava/no-skip-test
test.skip('parses an expression (foo a b\')', (t) => {
  t.deepEqual(parseExpression('foo a b\''), [
    {
      subroutine: 'foo',
      type: 'SUBROUTINE',
      values: [
        'a',
        'b\'',
      ],
    },
  ]);
});

test('parses an expression (foo a b)', (t) => {
  t.deepEqual(parseExpression('foo a b'), [
    {
      subroutine: 'foo',
github microsoftly / BotTester / test / ava / BotTesterFailure.ava.spec.ts View on Github external
test('will fail if one of multiple responses is incorrect', (t: IAvaBotTest) => {
    const bot = t.context.bot;

    bot.dialog('/', (session: Session) => {
        session.send('hello!');
        session.send('how are you doing?');
    });

    return t.throws(new BotTester(bot, getTestOptions(t))
        .sendMessageToBot('Hola!', 'hello!', 'NOPE')
        .runTest()
    );
});

// refer to mocha notes for skip reason
test.skip('it will fail if an empty collection is given', (t: IAvaBotTest) => {
    const bot = t.context.bot;

    bot.dialog('/', (session: Session) => {
        session.send('hello!');
    });

    try {
        new BotTester(bot, getTestOptions(t)).sendMessageToBot('Hola!', []);
    } catch (error) {
        t.true(error.Message.includes('expected response collections cannot be empty'));
    }
});

test('Will fail if response is not in the random response collection', (t: IAvaBotTest) => {
    const bot = t.context.bot;
github tableflip / guvnor / test / integration / cli.js View on Github external
})

test('Should start a process with arguments passed without delimiters', t => {
  const script = '/opt/guvnor/test/fixtures/hello-world.js'
  const name = t.context.procName()
  const argv = ['one', 'two', 'three']

  return t.context.cli(`guv start ${script} -n ${name} -a ${argv[0]} ${argv[1]} ${argv[2]}`)
  .then(utils.onProcessEvent('process:started', name, t.context.api))
  .then(() => t.context.cli('guv list --json'))
  .then(stdout => JSON.parse(stdout))
  .then(procs => procs.find(proc => proc.name === name))
  .then(proc => t.deepEqual(proc.master.argv.slice(2), argv))
})

test.skip('Should start a process with exec arguments', t => {
  // see https://github.com/yargs/yargs/issues/360
  const script = '/opt/guvnor/test/fixtures/hello-world.js'
  const name = t.context.procName()
  const execArgv = ['--log_gc', '--trace_code_flushing', '--disable_old_api_accessors']

  return t.context.cli(`guv start ${script} -n ${name} -e ${execArgv[0]} ${execArgv[1]} ${execArgv[2]}`)
  .then(utils.onProcessEvent('process:started', name, t.context.api))
  .then(() => t.context.cli('guv list --json'))
  .then(stdout => JSON.parse(stdout))
  .then(procs => procs.find(proc => proc.name === name))
  .then(proc => t.deepEqual(proc.master.execArgv.slice(2), execArgv))
})

test('Should increase number of cluster workers', t => {
  const script = '/opt/guvnor/test/fixtures/hello-world.js'
  const name = t.context.procName()
github denis-sokolov / remove-github-forks / test / simple.js View on Github external
}
    })

    removeGithubForks(mock.present, function(){
        lib.check(t, mock.calls(), [
          [ 'list', { per_page: 100, type: 'public' } ],
          [ 'get', { owner: lib.USER.login, repo: 'fork1' } ],
          [ 'listBranches', { owner: lib.USER.login, repo: 'fork1', per_page: 100 } ],
          [ 'listBranches', { owner: lib.AUTHOR.login, repo: 'upstream-lib', per_page: 100 } ]
        ])
        t.end()
    })
})

// Currently our logic does not delete this fork
test.skip('should delete a fork that has more branches, but all at upstream branch tips', function(t){
    var mock = lib.mock({
        listBranches: function(args){
            if (args.user === lib.USER.login)
                return [
                    { name: 'master', commit: lib.COMMIT_A },
                    { name: 'foo', commit: lib.COMMIT_A },
                    { name: 'bar', commit: lib.COMMIT_B }
                ];
            return [
                  { name: 'master', commit: lib.COMMIT_A },
                  { name: 'baz', commit: lib.COMMIT_B }
            ];
        },
        delete: true
    })
github buxlabs / amd-to-es6 / test / spec / bin / cli.js View on Github external
fs.rmdirSync(dirpath)
})

test.skip("allows to convert a single file and change it's suffix", t => {
  var src = 'test/fixture/cli/input-replace-suffix/input.js'
  var filepath = path.join(__dirname, '../../../', src)
  var result = shell.exec(`node ${bin} ${src} --replace --suffix=es6`, { silent: true })
  var destpath = filepath.replace(/\.js$/, '.es6')
  var output = fs.readFileSync(destpath, 'utf8')
  fs.unlinkSync(destpath)
  fs.writeFileSync(filepath, 'define(function () { return 142; });')
  t.truthy(result.code === 0)
  t.truthy(compare(output, 'export default 142;'))
})

test.skip('allows to convert multiple files and change their suffix', t => {
  var dir = 'test/fixture/cli/replace-suffix-files'
  var dirpath = path.join(__dirname, '../../../', dir)
  var src = 'test/fixture/cli/replace-suffix-files/input.js'
  var filepath = path.join(__dirname, '../../../', src)
  var result = shell.exec(`node ${bin} --src=${dirpath} --replace --suffix=es6`, { silent: true })
  var destpath = filepath.replace(/\.js$/, '.es6')
  var output = fs.readFileSync(destpath, 'utf8')
  fs.writeFileSync(filepath, 'define(function () { return 617; });')
  t.truthy(result.code === 0)
  t.truthy(compare(output, 'export default 617;'))
  fs.unlinkSync(destpath)
})

test('allows to beautify the output', t => {
  function replaceNewlines (str) {
    return str.replace(/(\W)/g, '')
github openscope / openscope / test / trafficGenerator / SpawnScheduler.spec.js View on Github external
const expectedCallCount = SpawnPatternCollection.spawnPatternModels.length;

    SpawnScheduler.init(aircraftControllerStub);

    t.true(createSchedulesFromListSpy.called);
    t.true(createNextScheduleSpy.callCount === expectedCallCount);
});

ava('.createSchedulesFromList() calls aircraftController.createPreSpawnAircraftWithSpawnPatternModel() if preSpawnAircraftList has items', (t) => {
    SpawnScheduler.init(aircraftControllerStub);
    SpawnScheduler.createSchedulesFromList();

    t.true(aircraftControllerStub.createPreSpawnAircraftWithSpawnPatternModel.called);
});

ava.skip('.createNextSchedule() calls GameController.game_timeout()', (t) => {
    const gameControllerGameTimeoutStub = {
        game_timeout: sandbox.stub(),
        game: {
            time: 0
        }
    };
    SpawnScheduler.init(aircraftControllerStub);
    const spawnPatternModel = SpawnPatternCollection._items[0];

    SpawnScheduler.createNextSchedule(spawnPatternModel, aircraftControllerStub);

    t.true(gameControllerGameTimeoutStub.game_timeout.called);
});

ava('.createAircraftAndRegisterNextTimeout() calls aircraftController.createAircraftWithSpawnPatternModel()', (t) => {
    SpawnScheduler.init(aircraftControllerStub);
github openscope / openscope / test / navigationLibrary / StandardRoute / StandardRouteModel.spec.js View on Github external
ava('._buildEntryAndExitCollections() maps rwy fixes to _entryCollection when exitPoints is not present and rwy is present', t => {
    const model = new StandardRouteModel(SID_WITHOUT_EXIT_MOCK.TRALR6);
    model._buildEntryAndExitCollections(SID_WITHOUT_EXIT_MOCK.TRALR6);

    const segmentModelNames = _map(model._entryCollection._items, (segmentModel) => segmentModel.name);

    t.true(_isEqual(segmentModelNames, _keys(SID_WITHOUT_EXIT_MOCK.TRALR6.rwy)));
});

ava.skip('._findStandardWaypointModelsForRoute() throws if entry does not exist within the collection', t => {
    const model = new StandardRouteModel(STAR_MOCK);

    t.throws(() => model._findStandardWaypointModelsForRoute('threeve', '25R'));
});

ava.skip('._findStandardWaypointModelsForRoute() throws if exit does not exist within the collection', t => {
    const model = new StandardRouteModel(STAR_MOCK);

    t.throws(() => model._findStandardWaypointModelsForRoute('DRK', 'threeve'));
});

ava('._findStandardWaypointModelsForRoute() returns a list of StandardRouteWaypointModels when _entryCollection and _exitCollection exist', t => {
    const model = new StandardRouteModel(STAR_MOCK);
    const result = model._findStandardWaypointModelsForRoute(ENTRY_FIXNAME_MOCK, RUNWAY_NAME_MOCK);

    t.true(result.length === 7);
});

ava('._findStandardWaypointModelsForRoute() returns a list of StandardRouteWaypointModels when _bodySegmentModel does not exist', t => {
    const model = new StandardRouteModel(SID_WITHOUT_BODY_MOCK);
    const result = model._findStandardWaypointModelsForRoute(RUNWAY_NAME_MOCK, 'MLF');
github openscope / openscope / test / aircraft / Pilot / Pilot.spec.js View on Github external
t.true(_isArray(result));
    t.true(result[0]);
    t.true(result[1].log === 'cleared to McCarran International Airport via the KEPEC3 arrival');
    t.true(result[1].say === 'cleared to McCarran International Airport via the KEPEC THREE arrival');
});

ava('.applyArrivalProcedure() calls #_fms.replaceArrivalProcedure() with the correct parameters', (t) => {
    const pilot = createPilotFixture();
    const replaceArrivalProcedureSpy = sinon.spy(pilot._fms, 'replaceArrivalProcedure');

    pilot.applyArrivalProcedure(validRouteStringMock, airportNameMock);

    t.true(replaceArrivalProcedureSpy.calledWithExactly(validRouteStringMock));
});

ava.skip('.applyDepartureProcedure() returns an error when passed an invalid sidId', (t) => {
    const expectedResult = [false, 'SID name not understood'];
    const pilot = new Pilot(createFmsDepartureFixture(), createModeControllerFixture(), createNavigationLibraryFixture());
    const result = pilot.applyDepartureProcedure('~!@#$%', airportIcaoMock);

    t.true(_isEqual(result, expectedResult));
    t.false(pilot.hasDepartureClearance);
});

ava.skip('.applyDepartureProcedure() returns an error when passed an invalid runway', (t) => {
    const expectedResult = [false, 'unsure if we can accept that procedure; we don\'t have a runway assignment'];
    const pilot = new Pilot(createFmsDepartureFixture(), createModeControllerFixture(), createNavigationLibraryFixture());
    const result = pilot.applyDepartureProcedure(sidIdMock, null, airportIcaoMock);

    t.true(_isEqual(result, expectedResult));
    t.false(pilot.hasDepartureClearance);
});
github xmppjs / xmpp.js / packages / plugins / ava / bind.js View on Github external
'use strict'

const test = require('ava')
const {match, stanza, plugin} = require('../bind')
const xml = require('@xmpp/xml')

test.skip('plugin', t => {
  const client = {}
  plugin(client)
  t.true(typeof client.bind === 'function')
})

test.skip('match()', t => {
  const features = xml``
  t.is(match(features), undefined)

  const bind = xml``
  features.cnode(bind)
  t.is(match(features), bind)
})

test.skip('stanza()', t => {
  t.deepEqual(stanza(), (xml`
    
      
    
  `))

  t.deepEqual(stanza('foobar'), (`