How to use @cardstack/test-support - 3 common examples

To help you get started, we’ve selected a few @cardstack/test-support 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 cardstack / cardstack / packages / hub / node-tests / support.js View on Github external
exports.createDefaultEnvironment = async function(initialModels = []) {
  let repoPath = await temp.mkdir('cardstack-server-test');

  // TODO: The git writer should make its own local repo when it
  // starts up the first time.
  let { head, repo } = await makeRepo(repoPath);

  let factory = new JSONAPIFactory();

  let user = factory.addResource('users', 'the-default-test-user').withAttributes({
    fullName: 'Default Test Environment',
    email: 'test@example.com'
  });

  factory.addResource('plugin-configs')
    .withAttributes({
      module: '@cardstack/hub',
    }).withRelated(
github cardstack / cardstack / packages / drupal / node-tests / harness.js View on Github external
async function go() {
  let factory = new JSONAPIFactory();
  factory.addResource('data-sources').withAttributes({
    'source-type': '@cardstack/drupal',
    params: {
      url: 'http://localhost',
      authToken: process.env.DRUPAL_TOKEN,
      openAPIPatch
    }
  });
  await createDefaultEnvironment(__dirname + '/../', factory.getModels());
}
github cardstack / cardstack / packages / hub / node-tests / support.js View on Github external
exports.destroyDefaultEnvironment = async function(env) {
  await env.teardown();
  await destroyIndices();
  await temp.cleanup();
};

@cardstack/test-support

Shared test support for cardstack packages.

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages