it("add", () => deepStrictEqual(1 + 1, 1))
 it('shifts a single point and stays positive', function () {
   const curve = new LiquidityCurve([ [5, 5] ])
   assert.deepStrictEqual(curve.shiftX(-10).getPoints(),
     [ [0, 5] ])
 })
 it('stays positive', function () {
   const curve = new LiquidityCurve([ [0, 0], [10, 10] ])
   assert.deepStrictEqual(curve.shiftY(-5).getPoints(),
     [ [5, 0], [10, 5] ])
 })
 log, err => {
     assert.deepStrictEqual(err, errors.NoSuchBucket);
     done();
 });
 metadata.getBucket(bucketName, log, err => {
     assert.deepStrictEqual(err, errors.NoSuchBucket);
     return checkBucketListing(authInfo, bucketName, 0, done);
 });
	it("should have a valid ratings structure", function () {
		assert.deepStrictEqual(codeClimateYAML.ratings.paths, ["**.css", "**.js", "**.md", "bin/**/*"],
            "Missing / invalid rating paths");
	});
 log, err => {
     assert.deepStrictEqual(err, errors.AccessDenied);
     done();
 });
    it('`_.' + methodName + '` should work with string objects', function() {
      var actual = func(Object('abc')).sort();

      assert.deepStrictEqual(actual, ['0', '1', '2']);
    });
    it('`_.' + methodName + '` should work with array-like objects', function() {
      var object = { '0': 'a', 'length': 1 },
          actual = func(object).sort();

      assert.deepStrictEqual(actual, ['0', 'length']);
    });
 .on('finish', common.mustCall(() => {
   assert.deepStrictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef',
                          'result should match original string');
 }));
// Flags: --expose_internals
'use strict';
const common = require('../common');
const assert = require('assert');
const internalModule = require('internal/module');

// Module one loads two too so the expected depth for two is, well, two.
assert.strictEqual(internalModule.requireDepth, 0);
const one = require(common.fixturesDir + '/module-require-depth/one');
const two = require(common.fixturesDir + '/module-require-depth/two');
assert.deepStrictEqual(one, { requireDepth: 1 });
assert.deepStrictEqual(two, { requireDepth: 2 });
assert.strictEqual(internalModule.requireDepth, 0);
 it("divide", () => deepStrictEqual(1 / 0, 1))
 it("multiply", () => deepStrictEqual(1 * 1, 1))
 it("minus", () => deepStrictEqual(1 - 1, 0))
Exemple #15
0
 it('uses the default config when no config is provided', () => {
   const config = new Config();
   assert.deepStrictEqual(origConfig.categories, config.categories);
   assert.equal(origConfig.audits.length, config.audits.length);
 });
Exemple #16
0
    it('`_.' + methodName + '` should return the string keyed property names of `object`', function() {
      var actual = func({ 'a': 1, 'b': 1 }).sort();

      assert.deepStrictEqual(actual, ['a', 'b']);
    });
Exemple #17
0
 it('should not mutate the original config', () => {
   const configCopy = JSON.parse(JSON.stringify(origConfig));
   Config.generateNewFilteredConfig(configCopy, ['performance']);
   assert.deepStrictEqual(configCopy, origConfig, 'no mutations');
 });
// Flags: --expose-internals
'use strict';
const common = require('../common');
const assert = require('assert');

const { outHeadersKey } = require('internal/http');
const { OutgoingMessage } = require('http');

{
  // tests for _headers get method
  const outgoingMessage = new OutgoingMessage();
  outgoingMessage.getHeaders = common.mustCall();
  outgoingMessage._headers;
}

{
  // tests for _headers set method
  const outgoingMessage = new OutgoingMessage();
  outgoingMessage._headers = {
    host: 'risingstack.com',
    Origin: 'localhost'
  };

  assert.deepStrictEqual(
    Object.entries(outgoingMessage[outHeadersKey]),
    Object.entries({
      host: ['host', 'risingstack.com'],
      origin: ['Origin', 'localhost']
    }));
}
 objectPut(otherAccountAuthInfo, putObjRequest, log, err => {
     assert.deepStrictEqual(err, errors.NoSuchBucket);
     done();
 });
Exemple #20
0
 it('should calculate the permutations of a BigNumber', function () {
   assert.deepStrictEqual(permutations(math.bignumber(4)), math.bignumber(24))
   assert.deepStrictEqual(permutations(math.bignumber(5)), math.bignumber(120))
   assert.deepStrictEqual(permutations(math.bignumber(8)), math.bignumber(40320))
 })
 log, err => {
     assert.deepStrictEqual(err, errors.NoSuchUpload);
     return done();
 });
Exemple #22
0
 it('should calculate the permutations of a BigNumber, taking k at a time', function () {
   assert.deepStrictEqual(permutations(math.bignumber(5), math.bignumber(4)), math.bignumber(120))
   assert.deepStrictEqual(permutations(math.bignumber(6), math.bignumber(3)), math.bignumber(120))
   assert.deepStrictEqual(permutations(math.bignumber(9), math.bignumber(8)), math.bignumber(362880))
 })
 log, err => {
     assert.deepStrictEqual(err, errors.NoSuchBucket);
     confirmDeleted(done);
 });
Exemple #24
0
      stealthyDataView, stealthyInt32Array, stealthyUint8Array
    ],
    isTypedArray: [
      int32Array, uint8Array, buffer, stealthyInt32Array, stealthyUint8Array
    ],
    isUint8Array: [
      uint8Array, buffer, stealthyUint8Array
    ]
  };

  for (const testedFunc of Object.keys(expected)) {
    const func = types[testedFunc];
    const yup = [];
    for (const value of all) {
      if (func(value)) {
        yup.push(value);
      }
    }
    console.log('Testing', testedFunc);
    assert.deepStrictEqual(yup, expected[testedFunc]);
  }
}

(async () => {
  const m = new vm.Module('');
  await m.link(() => 0);
  m.instantiate();
  await m.evaluate();
  assert.ok(types.isModuleNamespaceObject(m.namespace));
})();
 child.on('message', common.mustCall(function(recv) {
   assert.deepStrictEqual(msg, recv);
 }));
Exemple #26
0
 it('toJSON', function () {
   assert.deepStrictEqual(new Complex(2, 4).toJSON(), { 'mathjs': 'Complex', re: 2, im: 4 })
   assert.deepStrictEqual(new Complex(3, 0).toJSON(), { 'mathjs': 'Complex', re: 3, im: 0 })
 })
 it('shifts all of the points\' Ys by the specified amount', function () {
   const curve = new LiquidityCurve([ [0, 0], [50, 60], [100, 100] ])
   assert.deepStrictEqual(curve.shiftY(1).getPoints(),
     [ [0, 1], [50, 61], [100, 101] ])
 })
Exemple #28
0
 it('compare', function () {
   assert.deepStrictEqual(Complex.compare(new Complex(3, 4), new Complex(2, 4)), 1)
   assert.deepStrictEqual(Complex.compare(new Complex(2, 4), new Complex(2, 4)), 0)
   assert.deepStrictEqual(Complex.compare(new Complex(2, 4), new Complex(2, 7)), -1)
 })
Exemple #29
0
 it('should compare array - scalar', function () {
   assert.deepStrictEqual(smallerEq(2, [1, 2, 3]), [false, true, true])
   assert.deepStrictEqual(smallerEq([1, 2, 3], 2), [true, true, false])
 })
const {
    describe,
    it,
    before,
    after,
    beforeEach,
    afterEach,
    report,
} = require("../dist/index")

describe("Suite A", () => {
    before(() => console.log("before A"))
    after(() => console.log("after A"))
    beforeEach(() => console.log("beforeEach A test"))
    afterEach(() => console.log("afterEach A test"))
    it("add", () => deepStrictEqual(1 + 1, 1))
    it("minus", () => deepStrictEqual(1 - 1, 0))
})

describe("Suite B", () => {
    before(() => console.log("before B"))
    after(() => console.log("after B"))
    beforeEach(() => console.log("beforeEach B test"))
    afterEach(() => console.log("afterEach B test"))
    it("multiply", () => deepStrictEqual(1 * 1, 1))
    it("divide", () => deepStrictEqual(1 / 0, 1))
})

deepStrictEqual(report.ok(), false)
console.log(report.toString())