How to use immutable-class-tester - 9 common examples

To help you get started, we’ve selected a few immutable-class-tester 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 implydata / plywood / test / external / external.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(External, [
      {
        engine: 'mysql',
        source: 'diamonds',
        attributes: [
          { name: 'time', type: 'TIME' },
          { name: 'color', type: 'STRING' },
          { name: 'cut', type: 'STRING' },
          { name: 'tags', type: 'SET/STRING' }
        ]
      },

      {
        engine: 'druid',
        source: 'moon_child',
        timeAttribute: 'time',
        attributes: [
github implydata / plywood / test / datatypes / numberRange.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(NumberRange, [
      {
        start: 0,
        end: 0
      },
      {
        start: 1,
        end: 1,
        bounds: '[]'
      },
      {
        start: 0,
        end: 1
      },
      {
        start: 7,
        end: 9
github implydata / plywood / test / datatypes / set.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(Set, [
      {
        setType: 'NULL',
        elements: []
      },
      {
        setType: 'NULL',
        elements: [null]
      },
      {
        setType: 'BOOLEAN',
        elements: [true]
      },
      {
        setType: 'STRING',
        elements: []
      },
github implydata / plywood / test / expression / expression.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(Expression, [
      { op: 'literal', value: null },
      { op: 'literal', value: false },
      { op: 'literal', value: true },
      { op: 'literal', value: 0 },
      { op: 'literal', value: 0.1 },
      { op: 'literal', value: 6 },
      { op: 'literal', value: '' },
      { op: 'literal', value: 'Honda' },
      { op: 'literal', value: '$honda' },
      { op: 'literal', value: { setType: 'STRING', elements: [] }, type: 'SET' },
      { op: 'literal', value: { setType: 'STRING', elements: ['BMW', 'Honda', 'Suzuki'] }, type: 'SET' },
      { op: 'literal', value: { setType: 'NUMBER', elements: [0.05, 0.1] }, type: 'SET' },
      //{ op: 'literal', value: [{}], type: 'DATASET' },
      { op: 'literal', value: new Date('2015-10-10Z'), type: 'TIME' },
      { op: 'ref', name: 'authors' },
      { op: 'ref', name: 'light_time' },
github implydata / plywood / test / datatypes / attributeInfo.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(AttributeInfo, [
      { name: 'time', type: 'TIME' },
      { name: 'color', type: 'STRING' },
      { name: 'cut', type: 'STRING' },
      { name: 'cut', type: 'STRING', cardinality: 100 },
      { name: 'cut', type: 'STRING', range: { start: 'A', end: 'F' } },
      { name: 'tags', type: 'SET/STRING' },
      { name: 'carat', type: 'NUMBER', nativeType: 'STRING' },
      { name: 'count', type: 'NUMBER', unsplitable: true, maker: { op: 'count' } },
      {
        name: 'price',
        type: 'NUMBER',
        unsplitable: true,
        maker: { op: 'sum', expression: { op: 'ref', name: 'price' } }
      },
      { name: 'tax', type: 'NUMBER', unsplitable: true },
      { name: 'vendor_id', nativeType: 'hyperUnique', type: "NULL" }
github implydata / plywood / test / datatypes / dataset.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(Dataset, [
      {
        attributes: [
          { name: 'x', type: 'NUMBER' },
          { name: 'y', type: 'NUMBER' }
        ],
        data: [
          { x: 1, y: 2 },
          { x: 2, y: 3 }
        ]
      },

      {
        keys: ['BestCity'],
        attributes: [
          { name: 'Void', type: 'NULL' },
          { name: 'SoTrue', type: 'BOOLEAN' },
github implydata / plywood / test / actions / action.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(Action, [
      {
        action: 'filter',
        expression: {
          op: 'chain',
          expression: { op: 'ref', name: 'myVar' },
          action: { action: 'is', expression: { op: 'literal', value: 5 } }
        }
      },
      {
        action: 'split',
        name: 'Page',
        expression: { op: 'ref', name: 'page' },
        dataName: 'myData'
      },
      {
        action: 'split',
github implydata / plywood / test / datatypes / timeRange.mocha.js View on Github external
it("is immutable class", () => {
    testImmutableClass(TimeRange, [
      {
        start: new Date('2015-01-26T04:54:10Z'),
        end: new Date('2015-01-26T05:54:10Z')
      },
      {
        start: new Date('2015-01-26T04:54:10Z'),
        end: new Date('2015-01-26T05:00:00Z')
      }
    ]);
  });
github allegro / turnilo / src / common / models / collection / collection.mocha.ts View on Github external
it("is an immutable class", () => {
    testImmutableClass(Collection, [
      CollectionFixtures.testOneOnlyJS(),
      CollectionFixtures.testOneTwoJS()
    ], { context });
  });

immutable-class-tester

A helper for testing immutable classes

Apache-2.0
Latest version published 8 months ago

Package Health Score

56 / 100
Full package analysis

Popular immutable-class-tester functions