mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
32 lines
649 B
TypeScript
32 lines
649 B
TypeScript
|
import { codeBlock } from 'common-tags';
|
||
|
import { parse as parseToml } from './toml';
|
||
|
|
||
|
describe('util/toml', () => {
|
||
|
it('works', () => {
|
||
|
const input = codeBlock`
|
||
|
[tool.poetry]
|
||
|
## Hello world
|
||
|
include = [
|
||
|
"README.md",
|
||
|
{ path = "tests", format = "sdist" }
|
||
|
]
|
||
|
`;
|
||
|
|
||
|
expect(parseToml(input)).toStrictEqual({
|
||
|
tool: {
|
||
|
poetry: {
|
||
|
include: ['README.md', { path: 'tests', format: 'sdist' }],
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
});
|
||
|
|
||
|
it('handles invalid toml', () => {
|
||
|
const input = codeBlock`
|
||
|
!@#$%^&*()
|
||
|
`;
|
||
|
|
||
|
expect(() => parseToml(input)).toThrow(SyntaxError);
|
||
|
});
|
||
|
});
|