How to use the assert.strict.equal function in assert

To help you get started, we’ve selected a few 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 micromatch / braces / test / braces.compile.js View on Github external
it('should compile zero-padded numeric ranges with increments', () => {
      assert.equal(compile(parse('{01..05..2}')), '(01|03|05)');
    });
  });
github jonschlinkert / tabstops / test / variable-placeholder.js View on Github external
it('Parser, invalid variables with defaults', () => {
      assert.equal(compile('${name:value')(), '${name:value');
      assert.equal(compile('${a:bar${b:foobar}')(), '${a:barfoobar');
    });
  });
github jonschlinkert / templates / test / File.js View on Github external
it('should work with null', () => {
      let val = null;
      let file = new File();
      file.contents = val;
      assert.equal(file.contents, null);
    });
github micromatch / picomatch / test / posix-classes.js View on Github external
it('should not create an invalid posix character class:', () => {
      assert.equal(convert('[:al:]'), '(?:\\[:al:\\]|[:al:])');
      assert.equal(convert('[abc[:punct:][0-9]'), '(?=.)[abc\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~\\[0-9]');
    });
github beameio / beame-sdk / tests / unit_tests / test_commonutils.js View on Github external
it('max respected', () => {
		let min = 100;
		let max = 20000;
		let n = 0;
		for(let i = 0; i <= 12; i++) {
			n = commonUtils.exponentialTimeWithJitter(i, min, max);
			debug(`${i}: ${n}`);
		}
		assert.equal(n, max);
	});
github jonschlinkert / templates / test / File.js View on Github external
it('should normalize a file path', () => {
      assert.equal(File.normalize(), '');
      assert.equal(File.normalize('foo\\bar'), 'foo/bar');
      assert.equal(File.normalize('foo\\bar\\'), 'foo/bar');
      assert.equal(File.normalize('foo/bar/'), 'foo/bar');
    });
  });
github beameio / beame-sdk / tests / unit_tests / test_ocsp.js View on Github external
it('generateOcspRequest - no x509 & no pem combinations', async () => {
		const issuerCertUrl = cred.certData.issuer.issuerCertUrl;
		assert(issuerCertUrl);
		const certName = issuerCertUrl.substring(issuerCertUrl.lastIndexOf('/') + 1);
		const pemPath = path.join(config.issuerCertsPath, `${certName.substring(0, certName.lastIndexOf('.'))}.pem`);

		assert(DirectoryServices.doesPathExists(pemPath));

		let res = ocspUtils.generateOcspRequest(cred.fqdn, cred.X509, null);
		assert.equal(res, null);

		res = ocspUtils.generateOcspRequest(cred.fqdn, null, pemPath);
		assert.equal(res, null);

		res = ocspUtils.generateOcspRequest(cred.fqdn, null, null);
		assert.equal(res, null);

		res = ocspUtils.generateOcspRequest();
		assert.equal(res, null);
	});
github jonschlinkert / templates / test / collection.helpers-async.js View on Github external
it('should support sync helpers by default', async () => {
      pages.options.asyncHelpers = false;

      const upper = str => str.toUpperCase();
      pages.helper('upper', upper);

      assert.equal(pages.helper('upper').helper.toString(), upper.toString());
      const page = pages.get('a.hbs');
      await pages.render(page);

      assert.equal(page.contents.toString(), 'a BRIAN b');
      assert.equal(pages.ids.size, 0);
    });
github jonschlinkert / tabstops / test / render-placeholders.js View on Github external
it('should render multiple nested template literals', async () => {
    assert.equal(await render('${4:${homepage:https://github.com/${6:${username}}}}'), 'https://github.com/');
    assert.equal(await render('${homepage:https://github.com/${6:${username}}}'), 'https://github.com/');
    assert.equal(await render('${homepage:https://github.com/${6:${username}}}', { homepage: 'https://github.com/jonschlinkert'}), 'https://github.com/jonschlinkert');
    assert.equal(await render('${homepage:https://github.com/${6:${username}}}', { username: 'jonschlinkert'}), 'https://github.com/jonschlinkert');
    assert.equal(await render('${homepage:https://github.com/${6:${username}}}', { username: 'jonschlinkert', homepage: 'https://github.com/doowb' }), 'https://github.com/doowb');
    assert.equal(await render('${foo:before ${ABC} middle ${XYZ} after}', { ABC: 'one', XYZ: 'two' }), 'before one middle two after');
    assert.equal(await render('${foo:before ${ABC} middle ${XYZ} after}', { foo: 'bar' }), 'bar');
  });
github jonschlinkert / templates / test / File.js View on Github external
it('should set base to given value', () => {
      let val = '/';
      let file = new File({ base: val });
      assert.equal(file.base, val);
    });
  });