@appsemble/utils 0.25.2 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/remap.test.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { IntlMessageFormat } from 'intl-messageformat';
2
2
  import { beforeEach, describe, expect, it, vi } from 'vitest';
3
+ import { createExampleContext, examples } from './examples.js';
3
4
  import { remap } from './remap.js';
4
5
  function runTests(tests) {
5
6
  it.each(Object.entries(tests))('should %s', (name, { context, expected, history, input, mappers, messages, userInfo }) => {
@@ -1166,4 +1167,11 @@ describe('user', () => {
1166
1167
  },
1167
1168
  });
1168
1169
  });
1170
+ describe.each(Object.entries(examples))('should test remapper example: %s', (name, { input, remapper, result: expected, skip }) => {
1171
+ it.skipIf(skip)('to be valid.', () => {
1172
+ const context = createExampleContext(new URL('https://example.com'), 'en');
1173
+ const result = remap(remapper, input, context);
1174
+ expect(result).toStrictEqual(expected);
1175
+ });
1176
+ });
1169
1177
  //# sourceMappingURL=remap.test.js.map