Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 9, 2022
1 parent bfa6c27 commit 6bcf5e4
Show file tree
Hide file tree
Showing 14 changed files with 3,028 additions and 879 deletions.
2,131 changes: 2,131 additions & 0 deletions test/snapshots/title.js.md

Large diffs are not rendered by default.

Binary file added test/snapshots/title.js.snap
Binary file not shown.
8 changes: 8 additions & 0 deletions test/title/property.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { testSnapshots } from '../helpers/snapshot.js'

testSnapshots('`title` property', [
[[{ title: 'a' }]],
[[{ title: '' }]],
[[{ title: ' ' }]],
[[{ title: true }]],
])
69 changes: 0 additions & 69 deletions test/title/main.js → test/title/serialize.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import { testSnapshots } from '../helpers/snapshot.js'

testSnapshots('`title` property', [
[[{ title: 'a' }]],
[[{ title: '' }]],
[[{ title: ' ' }]],
[[{ title: true }]],
])

testSnapshots('Truncating titles', [
// eslint-disable-next-line no-magic-numbers
[['a'.repeat(118)]],
// eslint-disable-next-line no-magic-numbers
[['a'.repeat(119)]],
])

const getNamedFunction = function () {
return function func() {}
}
Expand Down Expand Up @@ -92,58 +78,3 @@ testSnapshots('Titles serialization', [
// Serializing ANSI sequences
[['\u001B[31mtext\u001B[39m']],
])

testSnapshots(
'Titles serialization for unsafe properties',
[
[
[
{
// eslint-disable-next-line fp/no-get-set
get argA() {
throw new Error('test')
},
},
],
],
],
true,
)

const PROXY_METHODS = [
'set',
'get',
'deleteProperty',
'has',
'ownKeys',
'defineProperty',
'getOwnPropertyDescriptor',
'isExtensible',
'preventExtensions',
'getPrototypeOf',
'setPrototypeOf',
'apply',
'constructor',
]

PROXY_METHODS.forEach((proxyMethod) => {
testSnapshots(
`Titles serialization for proxies | ${proxyMethod}`,
[
[
[
// eslint-disable-next-line fp/no-proxy
new Proxy(
{},
{
[proxyMethod]() {
throw new Error('unsafe')
},
},
),
],
],
],
true,
)
})
Loading

0 comments on commit 6bcf5e4

Please sign in to comment.