-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also consider non stylistic attribute valid parameters on SVG targets #…
- Loading branch information
1 parent
c54041a
commit ca71829
Showing
11 changed files
with
343 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const cBlack = 'color:#252423;' | ||
const cWhite = 'color:#FFF;' | ||
const cRed = 'color:#FF4B4B;' | ||
const bgRed = cBlack+'background-color:#FF4B4B;' | ||
const cGreen = 'color:#18FF74;' | ||
const bgGreen = cBlack+'background-color:#18FF74;' | ||
|
||
function log(testName, expected, received, isPassing) { | ||
if (!isPassing) { | ||
console.log('%c FAIL ' + '%c ' + testName, bgRed, cRed); | ||
console.log('%c✓ ' + '%cExpected: ' + '%c' + expected, cGreen, cWhite, cGreen); | ||
console.log('%c✕ ' + '%cReceived: ' + '%c' + received, cRed, cWhite, cRed); | ||
} else { | ||
console.log('%c SUCCESS ' + '%c ' + testName, bgGreen, cWhite); | ||
} | ||
} | ||
|
||
export function test(testName, testFunc) { | ||
try { | ||
const { expected, received, isPassing } = testFunc(); | ||
log(testName, expected, received, isPassing); | ||
} catch(e) { | ||
console.log('%c TEST ERROR ' + '%c ' + testName, bgRed, cRed); | ||
return console.log(e); | ||
} | ||
} | ||
|
||
export function expect(value) { | ||
return { | ||
toBe: (expected) => { | ||
return { | ||
expected, | ||
received: value, | ||
isPassing: value === expected | ||
} | ||
}, | ||
toBeSuperiorTo: (expected) => { | ||
return { | ||
expected, | ||
received: value, | ||
isPassing: value > expected | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.