Skip to content

Commit ee3ca41

Browse files
committed
test(web): #105 review — the stylesheet check no longer compares a string with undefined
`head` is always a string, so `head !== undefined` was always true and the condition was only ever "depth 0 or 1". Said plainly now. The check behaves as before: run alone against samples, it still fails on an unscoped rule at the top level and inside @media, and passes the real stylesheet.
1 parent c44f468 commit ee3ca41

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎web/test/unit/skin.test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test('every rule of the stylesheet is under body.lc-web', () => {
7171
depth++; head = '';
7272
} else if (ch === '}') { depth--; head = ''; }
7373
else if (ch === ';' && depth > 0) { head = ''; }
74-
else if (depth === 0 || (depth === 1 && head !== undefined)) { head += ch; }
74+
else if (depth === 0 || depth === 1) { head += ch; }
7575
}
7676
assert.strictEqual(depth, 0, 'balanced braces');
7777
assert.deepStrictEqual(bad.filter((s) => s && !/^\d/.test(s)), []);

0 commit comments

Comments
 (0)