How to use the power-assert.equal function in power-assert

To help you get started, we’ve selected a few power-assert 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 meganetaaan / vue-8-puzzle / test / unit / specs / board.spec.ts View on Github external
assert.equal(board.blocks[0], 3)
    assert.equal(board.blocks[3], 0)
    assert.equal(board.blankpos, 3)

    board.swapRight(3)
    assert.equal(board.blocks[3], 4)
    assert.equal(board.blocks[4], 0)
    assert.equal(board.blankpos, 4)

    board.swapAbove(4)
    assert.equal(board.blocks[4], 1)
    assert.equal(board.blocks[1], 0)
    assert.equal(board.blankpos, 1)

    board.swapLeft(1)
    assert.equal(board.blocks[1], 3)
    assert.equal(board.blocks[0], 0)
    assert.equal(board.blankpos, 0)

    board.swapAbove(3)
    assert.equal(board.blocks[3], 0)
    assert.equal(board.blocks[0], 4)
    assert.equal(board.blankpos, 3)
  })
  it('should throw error when no-empty block swapped', () => {
github vanwagonet / middle-router / test / server.js View on Github external
it('cannot listen without a window object', () => {
        let router = Router()
        assert.throws(() => router.start(), 'start should throw without a window')
        assert.equal(router.isListening, false, 'isListening should still be false')
      })
    })
github alibaba-fusion / next / test / field / options-spec.js View on Github external
it('should support `defaultValue`', function() {
            const inputValue = 'my value';
            const field = new Field(this);
            field.init('input', {props: {defaultValue: inputValue}});
            assert.equal(field.getValue('input'), inputValue);
        });
github googleapis / nodejs-firestore / test / path.js View on Github external
it('escapes special characters', function() {
    let path = new FieldPath('f.o.o');
    assert.equal(path.formattedName, '`f.o.o`');
  });
github bokuweb / flownes / test / uint / cpu.spec.js View on Github external
it('LDY_ABSX', () => {
        mockedROM = new ROM(new Uint8Array([op.LDY_ABSX, 0xA5, 0x10]));
        bus.ROM = mockedROM;
        cpu.registors.X = 0x05;
        mockedMemory.write(0x10AA, 0xAA);
        const cycle = cpu.exec();
        const expected = {
          ...defaultRegistors,
          P: { ...defaultRegistors.P, negative: true },
          PC: 0x8003,
          Y: 0xAA,
          X: 0x05,
        };
        assert.equal(cycle, 4);
        assert.deepEqual(cpu.registors, expected);
      });
    });
github bokuweb-sandbox / react-balloon / test / helloworld.spec.js View on Github external
it('Should root element have expected element and styles', () => {
    const balloon = shallow();
    const expectedStyles = {width: '100%', height: '100%', zIndex: 100};
    assert.equal(balloon.type(), 'div');
    assert.deepEqual(balloon.prop('style'), expectedStyles);
  });
github reptar / reptar / test / unit / plugin / event-handler.spec.js View on Github external
assert.equal(newVal, handlerValue);

      const modifierFn = sinon.spy(val => val * val);
      const trailingNoopFn = sinon.spy();

      instance.addEventHandler(handlerName, modifierFn);
      instance.addEventHandler(handlerName, trailingNoopFn);

      try {
        newVal = await instance.processEventHandlers(handlerName, handlerValue);
      } catch (e) {
        throw e;
      }

      assert.equal(noopFunc.callCount, 2);
      assert.equal(promiseFn.callCount, 2);
      assert.equal(modifierFn.callCount, 1);
      assert.ok(modifierFn.calledWith(5));
      assert.equal(trailingNoopFn.callCount, 1);

      assert.equal(newVal, handlerValue * handlerValue);
    });
github likr / egraph / test / transformer / edge-concentration / edge-concentration.js View on Github external
.addEdge(v1, w1)
        .addEdge(v1, w2)
        .addEdge(v2, w1)
        .addEdge(v2, w2)
      const transformed = new EdgeConcentrationTransformer().transform(graph)
      assert.equal(transformed.inDegree(u1), 0)
      assert.equal(transformed.outDegree(u1), 1)
      assert.equal(transformed.inDegree(u2), 0)
      assert.equal(transformed.outDegree(u2), 1)
      assert.equal(transformed.inDegree(v1), 1)
      assert.equal(transformed.outDegree(v1), 1)
      assert.equal(transformed.inDegree(v2), 1)
      assert.equal(transformed.outDegree(v2), 1)
      assert.equal(transformed.inDegree(w1), 2)
      assert.equal(transformed.outDegree(w1), 0)
      assert.equal(transformed.inDegree(w2), 2)
      assert.equal(transformed.outDegree(w2), 0)
    })
github kt3k / kocha / packages / kocha / examples / hooks-pass.js View on Github external
it('test 1', () => {
      assert.equal(b, 1)
      assert.equal(be, 2)
      assert.equal(a, 0)
      assert.equal(ae, 1)
    })
  })
github formio / formio.js / src / components / day / Day.unit.js View on Github external
component.on('componentError', (err) => {
        assert.equal(err.message, 'Date is not a valid day.');
        assert.equal(err.component.key, 'date');
        done();
      });