fix(build): modernize package exports, tooling configuration, and test setup

This commit is contained in:
2026-05-01 18:29:53 +00:00
parent e42d8fd229
commit 536e3c52d4
10 changed files with 7063 additions and 4113 deletions
+28
View File
@@ -0,0 +1,28 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as smartyaml from '../ts/index.js';
let yamlString = `someKey: someValue
someKey2: someValue2
`;
tap.test('should convert yaml string to object', async () => {
let myObject = await smartyaml.yamlStringToObject(yamlString);
expect(myObject.someKey).toEqual('someValue');
expect(myObject.someKey2).toEqual('someValue2');
});
tap.test('should convert an object to a string', async () => {
let myObject = await smartyaml.yamlStringToObject(yamlString);
let myString = await smartyaml.objectToYamlString(myObject);
expect(myString).toEqual(yamlString);
});
// test some behaviours
tap.test('should allow dots in key', async () => {
let testString = `myKey.with.dots: some`;
let testObject = await smartyaml.yamlStringToObject(testString);
expect(testObject['myKey.with.dots']).toEqual('some');
});
export default tap.start();