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

To help you get started, we’ve selected a few assert-helpers 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 bevry / kava / source / examples / example1.js View on Github external
test('api is readonly within node', function () {
		// Only run if our environment supports this
		if ( typeof window === 'undefined' ) {
			// Attempt modification
			try {
				joe.blah = "was set when it shouldn't have been"
			}
			catch (err) {
				// https://travis-ci.org/bevry/joe/jobs/135251737
			}

			// Test that the modifications were not successful
			equal(joe.blah == null, true, `modification test, result: ${joe.blah}`)
		}
	})
github bevry / kava / source / examples / freeze.js View on Github external
test('api is readonly within node', function() {
		// Only run if our environment supports this
		if (typeof window === 'undefined') {
			// Attempt modification
			try {
				kava.blah = "was set when it shouldn't have been"
			} catch (err) {
				// https://travis-ci.org/bevry/kava/jobs/135251737
			}

			// Test that the modifications were not successful
			assert.equal(
				kava.blah == null,
				true,
				'modification test, result: ' + kava.blah
			)
		}
	})
})
github bevry / kava / source / tester.js View on Github external
runner.once('close', function() {
			output = output.replace(/[\n\s]+at .+/g, '').replace(/^\s|\s$/g, '')
			try {
				equal(output.trim(), expectedCleaned.trim())
			} catch (err) {
				return complete(err)
			}
			process.stdout.write('\n^^ the above was as expected ^^\n')
			return complete()
		})
	})

assert-helpers

Common utilities and helpers to make testing assertions easier

Artistic-2.0
Latest version published 5 months ago

Package Health Score

62 / 100
Full package analysis