mirror of
https://github.com/tauri-apps/tauri-toml.git
synced 2026-02-04 18:31:17 +01:00
31 lines
780 B
JavaScript
31 lines
780 B
JavaScript
'use strict'
|
|
module.exports = runTests
|
|
|
|
const path = require('path')
|
|
const t = require('./tap-is-deeply.js')
|
|
const glob = require('glob').sync
|
|
const TOML = require('../..')
|
|
const getExpected = require('./get-expected.js')
|
|
|
|
function runTests (parsers, valid) {
|
|
const tests = glob(`${valid}/*toml`)
|
|
|
|
parsers.forEach(parser => {
|
|
t.test(parser.name, t => {
|
|
t.test('stringify-asserts', t => {
|
|
t.plan(tests.length)
|
|
for (let spec of tests) {
|
|
const expected = getExpected(spec)
|
|
const name = path.basename(spec, '.toml')
|
|
try {
|
|
t.deeplyObjectIs(TOML.parse(parser.stringify(expected)), expected, name)
|
|
} catch (err) {
|
|
t.error(err, name)
|
|
}
|
|
}
|
|
})
|
|
t.done()
|
|
})
|
|
})
|
|
}
|