How to use the taskcluster-lib-urls.testRootUrl function in taskcluster-lib-urls

To help you get started, we’ve selected a few taskcluster-lib-urls 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 taskcluster / taskcluster / libraries / testing / src / schemas.js View on Github external
test(testCase.path, function() {
      // Load test data
      var filePath = testCase.path;
      // Prefix with basePath if a basePath is given
      if (options.basePath) {
        filePath = path.join(options.basePath, filePath);
      }
      var data = fs.readFileSync(filePath, {encoding: 'utf-8'});
      var json = JSON.parse(data);

      // Find schema
      var schema = libUrls.schema(libUrls.testRootUrl(), options.serviceName, testCase.schema);

      // Validate json
      var error = validate(json, schema);

      // Test errors
      if (testCase.success) {
        if (error !== null) {
          debug('Errors: %j', error);
        }
        assert(error === null,
          'Schema doesn\'t match test for ' + testCase.path);
      } else {
        assert(error !== null,
          'Schema matches unexpectedly test for ' + testCase.path);
      }
    });
github taskcluster / taskcluster / libraries / testing / src / schemas.js View on Github external
setup(async function() {
    const schemaset = new SchemaSet(options.schemasetOptions);
    validate = await schemaset.validator(libUrls.testRootUrl());
  });
github taskcluster / taskcluster / services / hooks / src / taskcreator.js View on Github external
constructor() {
    super({credentials: {}, rootUrl: libUrls.testRootUrl()});
    this.shouldFail = false;
    this.shouldNotProduceTask = false;
    this.fireCalls = [];
  }

taskcluster-lib-urls

Build urls for taskcluster resources.

MPL-2.0
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages