import {describe, test, expect} from "vitest"; import YamlEncoder from "~/services/encoder/yamlEncoder"; import {load} from "js-yaml"; describe('decode', () => { test('with empty data', () => { const result = YamlEncoder.decode("") expect(result).toBeNull() }) test('with data', () => { const result = YamlEncoder.decode(`title:\n a: 1\n b: 2\n c: [foo, bar]`) expect(result).toEqual({title: {a: 1, b: 2, c: ['foo', 'bar']}}) }) })