How to use the ava.only 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 TTLabs / EvaporateJS / test / aws_url.spec.js View on Github external
// aws_url
test('should respect aws_url if presented without cloudfront', (t) => {
  return testAwsUrl(t, { awsRegion: 'eu-central-1', aws_url: 'https://s3.dualstack.us-east-1.amazonaws.com' })
      .then(function (url) {
        expect(url).to.match(new RegExp('https://s3.dualstack.us-east-1.amazonaws.com/bucket/'))
      })
})

test('should respect aws_url if presented with cloudfront', (t) => {
  return testAwsUrl(t, { awsRegion: 'eu-central-1', aws_url: 'https://s3.dualstack.us-east-1.amazonaws.com', cloudfront: true })
      .then(function (url) {
        expect(url).to.match(new RegExp('https://s3.dualstack.us-east-1.amazonaws.com'))
      })
})

test.only('should allow the aws_url to be overriddden on add', (t) => {
  return testAwsUrl(t, { awsRegion: 'eu-central-1', aws_url: 'https://s3.dualstack.us-east-1.amazonaws.com', cloudfront: true },
      { configOverrides: { aws_url: 'https://s3.dualstack.us-east-3.amazonaws.com'} })
      .then(function (url) {
        expect(url).to.match(new RegExp('https://s3.dualstack.us-east-3.amazonaws.com'))
      })
})


// S3 Transfer Acceleration

test('should respect s3Acceleration with defaults', (t) => {
  return testAwsUrl(t, { s3Acceleration: true })
      .then(function (url) {
        expect(url).to.match(new RegExp('https://bucket.s3-accelerate.amazonaws.com/'))
    })
})
github functional-promises / functional-promises / tests / props.js View on Github external
const test = require('ava')
const FP = require('../')

test.only('FP.get(keys) static "partial app" pattern', t => {
  const result = FP.get('foo')
  t.true(typeof result === 'function', 'result should be a Function')
  t.is(result({foo: 'bar'}), 'bar', 'getter Function should return correct string')
})

test('fp.resolve(obj).get(...keyNames)', t => FP
  .resolve({foo: 'bar', baz: 'woo'})
  .get('foo', 'baz')
  .then(obj => t.is(obj.foo, 'bar'))
)

test('fp.resolve(obj).get(key, key2)', t => {
  return FP
  .resolve({foo: 'bar', baz: 'woo'})
  .get('foo', 'baz')
  .then(obj => t.is(obj.foo, 'bar'))
github microsoft / tsyringe / test / tests.ts View on Github external
function testWithContainer(
  name: string,
  run: (container: DependencyContainer, decorators: { inject: (token: InjectionToken) => any, injectable: () => any, registry: (...args: any[]) => any }) => GenericTest>,
  only: boolean = false) {
  const container = requireUncached("../../dist/DependencyContainer").default;
  const {injectable, inject, registry} = proxyquire("../../dist/decorators", {
    "./DependencyContainer": {default: container}
  })
  if(!only) {
    test(name, run(container, {injectable, inject, registry}));
  } else {
    test.only(name, run(container, {injectable, inject, registry}));
  }
}
github ben-eb / css-values / src / __tests__ / parser.js View on Github external
Object.keys(fixtures).forEach(key => {
    const {syntax, ast, debug} = fixtures[key];
    if (debug) {
        return test.only(key, macro, syntax, ast, debug);
    }
    test(key, macro, syntax, ast);
});
github superchargejs / framework / testing / drivers / ava.js View on Github external
only (name) {
    Ava.only(name, async t => this.test[name](t))
  }
github Ashlar / binance-api-node / test / ws-reconnect.js View on Github external
let server = new WebSocket.Server({ port })

server.on('connection', ws => {
  ws.on('message', () => server.clients.forEach(client => client.send('test')))
})

test.after.always('cleanup', () => {
  return new Promise(resolve => {
    server.close(() => {
      resolve()
    })
  })
})

test.only('[WS] reconnect when server is restarted', t => {
  return new Promise((resolve, reject) => {
    try {
      let isReconnect = false
      const url = () => `ws://localhost:${port}`
      const ws = openWebSocket(url)

      ws.addEventListener('open', () => {
        if (isReconnect) {
          ws.close(1000, undefined, { keepClosed: true })
          t.pass()
          resolve()
        } else {
          server.close()
          server = new WebSocket.Server({ port })
        }