const {test} = require('node:test'); const assert = require('node:assert'); const mutationAdapter = require('../../src/engine/mutation-adapter'); test('spec', () => { assert.strictEqual(typeof mutationAdapter, 'function'); }); test('convert DOM to Scratch object', () => { const testStringRaw = '"arbitrary" & \'complicated\' test string'; const testStringEscaped = '\\"arbitrary\\" & 'complicated' test string'; const xml = ``; const expectedMutation = { tagName: 'mutation', children: [], blockInfo: { text: testStringRaw } }; // TODO: do we want to test passing a DOM node to `mutationAdapter`? Node.js doesn't have built-in DOM support... const mutationFromString = mutationAdapter(xml); assert.deepEqual(mutationFromString, expectedMutation); });