How to use the chai.assert.isOk function in chai

To help you get started, we’ve selected a few chai 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 Paratii-Video / paratii-js / test / tcr / registry.spec.js View on Github external
let amountToAllowWei = paratii.eth.web3.utils.toWei('100')
    let amountToAllowInHex = paratii.eth.web3.utils.toHex(amountToAllowWei)
    let tx2 = await token.methods.approve(tcrRegistry.options.address, amountToAllowInHex).send()
    assert.isOk(tx2)

    // let allowance = await token.methods.allowance(address, tcrRegistry.options.address).call()
    // assert.equal(allowance, paratii.eth.web3.utils.toWei('100'))

    let applicationTx = await tcrRegistry.methods.apply(
      paratii.eth.web3.utils.soliditySha3('test_video_id'),
      paratii.eth.web3.utils.toWei('20'),
      ''
    ).send()

    assert.isOk(applicationTx)
    assert.isOk(applicationTx.events._Application)
    // console.log('apply Tx', applicationTx)
  })
github cedricpinson / osgjs / tests / osgAnimation / BasicAnimationManager.js View on Github external
}
                };
            }
        };

        var animations = basicAnimationManager.getAnimations();
        var animationName = Object.keys(animations)[0];
        basicAnimationManager.playAnimation(animationName, false);
        assert.isOk(
            basicAnimationManager._startAnimations[animationName] !== undefined,
            'check start animation queue'
        );

        basicAnimationManager._dirty = false;
        basicAnimationManager.update(null, nv);
        assert.isOk(
            basicAnimationManager._activeAnimations[animationName] !== undefined,
            'check animation ' + animationName + ' is playing'
        );

        // .x comes from the mockup anmation name
        assert.equal(basicTargets[0].value, 1, 'check target a value at t = ' + time);
        assert.equal(basicTargets[1].value, 1, 'check target b value at t = ' + time);

        time = 0.5;
        basicAnimationManager.update(null, nv);
        assert.equal(basicTargets[0].value, 0.5, 'check target a value at t = ' + time);
        assert.equal(basicTargets[1].value, 1, 'check target b value at t = ' + time);

        time = 3.5;
        basicAnimationManager.update(null, nv);
        assert.equal(basicTargets[0].value, 3, 'check target a value at t = ' + time);
github crystian / executor / test / utils.spec.js View on Github external
it('should return true 2', function() {
		let r = isObject({ key: '' });

		assert.isBoolean(r);
		assert.isOk(r);
	});
github Paratii-Video / paratii-js / test / paratii.ipfs.js View on Github external
it('should be able to use a pre-existing ipfs instance', async function () {
    let repoPath = '/tmp/pre-existing-ipfs'
    let ipfs = new Ipfs({
      bitswap: {
        maxMessageSize: 256 * 1024
      },
      repo: repoPath,
      start: true
    })
    let existingIPFS = new ParatiiIPFS({
      ipfs: {
        instance: ipfs
      }
    })
    assert.isOk(existingIPFS)
    await existingIPFS.getIPFSInstance()
    assert.isOk(existingIPFS.ipfs)
    assert.equal(existingIPFS.ipfs._repo.path, repoPath)
  })
})
github cedricpinson / osgjs / tests / osgViewer / Viewer.js View on Github external
window.cancelAnimationFrame = function() {
                assert.isOk(true, 'context lost does cancel render loop');
            };
github cedricpinson / osgjs / tests / osgDB / Input.js View on Github external
return input.readBufferArray().then(function(/*buffer*/) {
                assert.isOk(calledProgress === true, 'readBufferArray check progress callback');
                return P.resolve();
            });
        })();
github cedricpinson / osgjs / tests / osg / UpdateVisitor.js View on Github external
root.addUpdateCallback(new Froot());
        b.addUpdateCallback(new Fb());
        c.addUpdateCallback(new Fc());

        uv.apply(root);

        assert.isOk(stateSetUpdateCallbackCalled > 0, 'Called stateSet update callback');

        assert.isOk(callRoot === 1, 'Called root update callback');
        assert.isOk(callb === 1, 'Called b update callback');
        assert.isOk(callc === 0, 'Did not Call c update callback as expected');

        root.setNodeMask(~0);
        assert.isOk(callRoot === 1, 'Called root update callback');
        assert.isOk(callb === 1, 'Called b update callback');
        assert.isOk(callc === 0, 'Did not Call c update callback as expected');
    });
}
github nicolasdao / schemaglue / test / index.js View on Github external
resolvers: resolver
		})

		createExecutableSchema()
		assert.doesNotThrow(createExecutableSchema, Error, 'createExecutableSchema should have succeeded.')

		const { schema:schema_02, resolver:resolver_02 } = glue('./test/graphql/mock_02')
    
		assert.equal(schema_02.replace(/\n|\s|\t/g, ''), schema_321312.replace(/\n|\s|\t/g, ''), 'Oops, error in schema_02')
		assert.isOk(resolver_02, 'resolver_02 should exist.')
		assert.isOk(resolver_02.Query, 'resolver_02.Query should exist.')
		assert.isOk(resolver_02.Query.products, 'resolver_02.Query.products should exist.')
		assert.isOk(resolver_02.Query.variants, 'resolver_02.Query.variants should exist.')
		assert.isOk(resolver_02.Mutation, 'resolver_02.Mutation should exist.')
		assert.isOk(resolver_02.Mutation.productUpdateName, 'resolver_02.Mutation.productUpdateName should exist.')
		assert.isOk(resolver_02.Mutation.variantUpdateName, 'resolver_02.Mutation.variantUpdateName should exist.')
		assert.isOk(resolver_02.Subscription, 'resolver_02.Subscription should exist.')
		assert.isOk(resolver_02.Subscription.productNameChanged, 'resolver_02.Subscription.productNameChanged should exist.')
		assert.isOk(resolver_02.Subscription.variantNameChanged, 'resolver_02.Subscription.variantNameChanged should exist.')

		createExecutableSchema = () => makeExecutableSchema({
			typeDefs: schema_02,
			resolvers: resolver_02
		})

		createExecutableSchema()
		assert.doesNotThrow(createExecutableSchema, Error, 'createExecutableSchema should have succeeded.')

		const { schema:schema_03, resolver:resolver_03 } = glue('./test/graphql/mock_03')
    
		assert.equal(schema_03.replace(/\n|\s|\t/g, ''), schema_321312_B.replace(/\n|\s|\t/g, ''), 'Oops, error in schema_03')
		assert.isOk(resolver_03, 'resolver_03 should exist.')
github rubenspgcavalcante / webpack-chrome-extension-reloader / specs / changesTriggerer.specs.ts View on Github external
it("Should start the hot reloading server", () => {
    changesTriggerer(hotReloadServerMock, true);
    assert.isOk(hotReloadServerMock.listen.calledOnce);
  });
});