UNPKG

declapract

Version:

A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.

26 lines 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const checkEqualsString_1 = require("./checkEqualsString"); describe('checkEqualsString', () => { it('should return nothing when the string are equal', () => { const result = (0, checkEqualsString_1.checkEqualsString)({ declaredContents: 'a-string', foundContents: 'a-string', }); expect(result).not.toBeDefined(); }); it('should throw an error with a good looking diff when not equal', () => { try { (0, checkEqualsString_1.checkEqualsString)({ declaredContents: 'a-string', foundContents: 'b-string', }); fail('should not reach here'); } catch (error) { expect(error.message).toContain('toEqual'); expect(error.message).toMatchSnapshot(); // log example of it } }); }); //# sourceMappingURL=checkEqualsString.test.js.map