smartdiff/test/test.ts

15 lines
412 B
TypeScript
Raw Normal View History

2021-12-16 08:20:48 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdiff from '../ts/index';
tap.test('first test', async () => {
2021-12-17 00:39:51 +00:00
const text1 = 'hi there';
const text2 = 'hi Polly, there is a Sandwich.';
const patch = smartdiff.createDiff(text1, text2);
console.log(patch);
const result = smartdiff.applyPatch(text1, patch);
console.log(result);
expect(result).to.equal(text2);
2021-12-16 08:20:48 +00:00
});
tap.start();