How to use the power-assert.deepEqual 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 ktty1220 / cheerio-httpcli / test / redirect.js View on Github external
.submit(function (err, $, res, body) {
            assert(typeOf(res.cookies) === 'object');
            assert(res.cookies.user === 'guest');
            assert($.documentInfo().url === url);
            assert.deepEqual(JSON.parse(res.headers['trace-route']), [
              '/form/utf-8.html?reset_trace_route',
              '/~redirect_relative',
              '/manual/euc-jp.html'
            ]);
            done();
          });
        });
github mohayonao / ciseaux / test / sequence.js View on Github external
it("works", () => {
        let seq = new Sequence(true);

        let result1 = seq.apply(false);
        let result2 = seq.apply(false);

        assert(result1 instanceof Tape);
        assert(result2 instanceof Tape);
        assert(result1.duration === 0);
        assert(result2.duration === 0);
        assert(result1 !== result2);
        assert.deepEqual(result1.toJSON(), result2.toJSON());
      });
    });
github bokuweb / re-resizable / test / test-resize-box.js View on Github external
width={100} height={100}
        onResize={onResize}
        onResizeStart={onResizeStart}
        onResizeStop={onResizeStop}
        style={{ padding: '40px' }}
      />,
      document.getElementById('content')
    );
    const divs = TestUtils.scryRenderedDOMComponentsWithTag(resizable, 'div');
    const node = ReactDOM.findDOMNode(divs[6]);
    TestUtils.Simulate.mouseDown(node, { clientX: 0, clientY: 0 });
    mouseMove(200, 220);
    mouseUp(200, 220);
    assert.equal(onResizeStop.callCount, 1);
    assert(onResize.getCall(0).args[0] instanceof MouseEvent);
    assert.deepEqual(onResizeStop.getCall(0).args[1], 'bottomRight');
    assert.deepEqual(onResize.getCall(0).args[2].clientHeight, 320);
    assert.deepEqual(onResize.getCall(0).args[3], { width: 200, height: 220 });
  });
github mohayonao / ciseaux / test / tape.js View on Github external
{ data: 2, beginTime: 0, endTime: 10 },
          { data: 3, beginTime: 0, endTime: 10 },
          { data: 8, beginTime: 0, endTime: 10 },
          { data: 9, beginTime: 0, endTime: 10 },
        ], "tracks[0]");

        result = pickEach(tracks[1], [ "data", "beginTime", "endTime" ]);
        assert.deepEqual(result, [
          { data: 0, beginTime: 0, endTime: 20 },
          { data: 4, beginTime: 0, endTime: 10 },
          { data: 5, beginTime: 0, endTime: 10 },
          { data: 0, beginTime: 0, endTime: 20 },
        ], "tracks[1]");

        result = pickEach(tracks[2], [ "data", "beginTime", "endTime" ]);
        assert.deepEqual(result, [
          { data: 0, beginTime: 0, endTime: 20 },
          { data: 6, beginTime: 0, endTime: 10 },
          { data: 7, beginTime: 0, endTime: 10 },
          { data: 0, beginTime: 0, endTime: 20 },
        ], "tracks[2]");
      });
    });
github alibaba-fusion / next / test / cascader-select / index-spec.js View on Github external
{ value: '2973', label: '陕西', pos: '0-0' },
                ],
            });
            changeCalled = true;
        };

        wrapper = mount(
            
        );
        assert.deepEqual(getLabels(wrapper), ['铜川', '西安市']);

        const removeLink = wrapper.find('span.next-tag-close-btn').at(1);
        removeLink.simulate('click');
        assert.deepEqual(getLabels(wrapper), ['铜川']);
        assert(changeCalled);

        wrapper.setProps({
            displayRender: labelPath => labelPath.join(' / '),
        });
        assert.deepEqual(getLabels(wrapper), ['陕西 / 铜川']);
    });
github DefinitelyTyped / DefinitelyTyped / qs / qs-tests.ts View on Github external
() => {
  var arraysOfObjects = qs.parse('a[][b]=c');
  assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
}
github likr / egraph / test / layouter / sugiyama / normalize.js View on Github external
.addEdge(b, c)
      .addEdge(a, c)
    const layers = [[a], [b], [c]]
    const layerMap = {
      [a]: 0,
      [b]: 1,
      [c]: 2
    }
    normalize(graph, layers, layerMap, 5)
    const d = graph.vertices()[3]
    assert.equal(graph.numVertices(), 4)
    assert.equal(graph.numEdges(), 4)
    assert(graph.vertex(d).dummy)
    assert(graph.edge(a, d).dummy)
    assert(graph.edge(d, c).dummy)
    assert.deepEqual(layers, [[a], [b, d], [c]])
  })
})
github kjirou / escape-from-the-maze / test / models / MazeModel.es6 View on Github external
let maze, player, upstairs;
    maze = new MazeModel();
    maze.includeMapText([
      '#####',
      '#   #',
      '#   #',
      '#####'
    ].join('\n'));
    player = new PlayerThingModel();
    upstairs = new UpstairsThingModel();
    maze.addThing(player, [1, 1]);
    maze.addThing(upstairs, [maze.getHeight() - 2, maze.getWidth() - 2]);
    maze.walkThing(player, MazeModel.DIRECTIONS.RIGHT);
    maze.walkThing(player, MazeModel.DIRECTIONS.DOWN);
    maze.walkThing(player, MazeModel.DIRECTIONS.RIGHT);
    assert.deepEqual(maze.getCell([2, 3]).getThings(), [upstairs, player]);

    maze.walkThing(player, MazeModel.DIRECTIONS.RIGHT);
    maze.walkThing(player, MazeModel.DIRECTIONS.DOWN);
    assert.deepEqual(maze.getCell([2, 3]).getThings(), [upstairs, player], 'Can not move to impassable cell');

    maze.walkThing(player, MazeModel.DIRECTIONS.LEFT);
    assert.strictEqual(maze.getCell([2, 2]).getThing(), player);

    maze.walkThing(player, MazeModel.DIRECTIONS.UP);
    assert.strictEqual(maze.getCell([1, 2]).getThing(), player);
  });
github formio / formio.js / src / Formio.unit.js View on Github external
.then((response) => {
              assert.deepEqual(response, submission, 'Submission should match');
            });
        },