Sha256: 338cbf611c9d4c5f4b9babea7e529a2e4def095d075610884562cfe6fbe4de3b

Contents?: true

Size: 921 Bytes

Versions: 8

Compression:

Stored size: 921 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(actual, expected);
  });

  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(actual, expected);
    });
  });
});

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.50 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.49 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.48 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.47 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.46 node_modules/jsx-ast-utils/__tests__/src/index-test.js
immosquare-cleaner-0.1.45 node_modules/jsx-ast-utils/__tests__/src/index-test.js
decidim-0.26.8 packages/eslint-config/node_modules/jsx-ast-utils/__tests__/src/index-test.js