ts-standard
Version:
TypeScript Standard Style based on StandardJS
24 lines (20 loc) • 604 B
JavaScript
import test from 'tape'
import tsStandard from '../index.js'
test('api: lintFiles', async (t) => {
t.plan(2)
const [result] = await tsStandard.lintFiles([
'cli.js',
'constants.js',
'index.js',
'options.js',
'resolve-tsconfig.js'
])
t.equal(typeof result, 'object', 'result is an object')
t.equal(result.errorCount, 0)
})
test('api: lintText', async (t) => {
t.plan(2)
const [result] = await tsStandard.lintText('console.log("hi there")\n')
t.equal(typeof result, 'object', 'result is an object')
t.equal(result.errorCount, 1, 'should have used single quotes')
})