-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
15 lines (13 loc) · 552 Bytes
/
test.js
File metadata and controls
15 lines (13 loc) · 552 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import assert from 'node:assert/strict'
import test from 'node:test'
import {htmlEventAttributes} from './index.js'
test('htmlEventAttributes', function () {
assert.ok(Array.isArray(htmlEventAttributes), 'should be an array')
let index = -1
while (++index < htmlEventAttributes.length) {
const prop = htmlEventAttributes[index]
assert.equal(typeof prop, 'string', prop + ' should be string')
assert.strictEqual(prop, prop.trim(), prop + ' should be trimmed')
assert.ok(/^on[a-z]+$/.test(prop), prop + ' should be `a-z`')
}
})