Sha256: 29989413a166afe89e229658cbb02a6cd83b88a91e17c620081de84cc56f6b0e

Contents?: true

Size: 915 Bytes

Versions: 44

Compression:

Stored size: 915 Bytes

Contents

/* eslint-env mocha */
import fs from 'fs';
import path from 'path';
import assert from 'assert';
import core from '../../src/index';

const src = fs.readdirSync(path.resolve(__dirname, '../../src'))
  .filter(f => f.indexOf('.js') >= 0)
  .map(f => path.basename(f, '.js'));

describe('main export', () => {
  it('should export an object', () => {
    const expected = 'object';
    const actual = typeof core;

    assert.equal(expected, actual);
  });

  src.filter(f => f !== 'index').forEach((f) => {
    it(`should export ${f}`, () => {
      assert.equal(
        core[f],
        require(path.join('../../src/', f)).default // eslint-disable-line
      );
    });

    it(`should export ${f} from root`, () => {
      const file = `${f}.js`;
      const expected = true;
      const actual = fs.statSync(path.join(path.resolve('.'), file)).isFile();

      assert.equal(expected, actual);
    });
  });
});

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.21.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.20.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.19.1 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.19.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.18.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.17.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.16.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.15.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.14.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.13.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.12.2 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.12.1 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.12.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.11.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.10.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.9.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.8.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.7.0 node_modules/jsx-ast-utils/__tests__/src/index-test.js
govuk_publishing_components-17.6.1 node_modules/jsx-ast-utils/__tests__/src/index-test.js