smartdiff/test/test.ts
2021-12-17 01:39:51 +01:00

15 lines
412 B
TypeScript

import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdiff from '../ts/index';
tap.test('first test', async () => {
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);
});
tap.start();