Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
37 lines
915 B
Plaintext
37 lines
915 B
Plaintext
import { expectType } from 'tsd'
|
|
import { createWarning, createDeprecation } from '..'
|
|
|
|
const WarnInstance = createWarning({
|
|
name: 'TypeScriptWarning',
|
|
code: 'CODE',
|
|
message: 'message'
|
|
})
|
|
|
|
expectType<string>(WarnInstance.code)
|
|
expectType<string>(WarnInstance.message)
|
|
expectType<string>(WarnInstance.name)
|
|
expectType<boolean>(WarnInstance.emitted)
|
|
expectType<boolean>(WarnInstance.unlimited)
|
|
|
|
expectType<void>(WarnInstance())
|
|
expectType<void>(WarnInstance('foo'))
|
|
expectType<void>(WarnInstance('foo', 'bar'))
|
|
|
|
const buildWarnUnlimited = createWarning({
|
|
name: 'TypeScriptWarning',
|
|
code: 'CODE',
|
|
message: 'message',
|
|
unlimited: true
|
|
})
|
|
expectType<boolean>(buildWarnUnlimited.unlimited)
|
|
|
|
const DeprecationInstance = createDeprecation({
|
|
code: 'CODE',
|
|
message: 'message'
|
|
})
|
|
expectType<string>(DeprecationInstance.code)
|
|
|
|
DeprecationInstance()
|
|
DeprecationInstance('foo')
|
|
DeprecationInstance('foo', 'bar')
|