Skip to content

Commit

Permalink
Manually test number format specifiers applied to Symbols
Browse files Browse the repository at this point in the history
Adds manual tests that apply number format specifiers on Symbols
for each Console method that uses Formatter. This also updates a
previous test of the same nature to call console.groupEnd after
calls to group() and groupCollapsed() to clean up the console output
and prevent unnecessary nesting. See whatwg/console#113.
  • Loading branch information
domfarolino committed Mar 21, 2018
1 parent 94c053e commit 13436eb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions console/console-number-format-specifiers-symbol-manual.html
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Console Number Format Specifiers on Symbols</title>
<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
<meta name="assert" content="Console format specifiers on Symbols">
<link rel="help" href="https://console.spec.whatwg.org/#formatter">
</head>
<body>
<p>Open the console inside the developer tools. It should contain 15 lines, each of which are:</p>
<p><code>NaN</code></p>

<script>
const methods = ["log", "dirxml", "trace", "group", "groupCollapsed"];

for (method of methods) {
console[method]("%i", Symbol.for("description"));
if (method == "group" || method == "groupCollapsed") console.groupEnd();
console[method]("%d", Symbol.for("description"));
if (method == "group" || method == "groupCollapsed") console.groupEnd();
console[method]("%f", Symbol.for("description"));
if (method == "group" || method == "groupCollapsed") console.groupEnd();
}
</script>
</body>
</html>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Console Format Specifiers on Symbols</title>
<title>Console String Format Specifier on Symbols</title>
<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
<meta name="assert" content="Console format specifiers on Symbols">
<link rel="help" href="https://console.spec.whatwg.org/#formatter">
Expand All @@ -15,7 +15,9 @@
console.dirxml("%s", Symbol.for("description"));
console.trace("%s", Symbol.for("description"));
console.group("%s", Symbol.for("description"));
console.groupEnd();
console.groupCollapsed("%s", Symbol.for("description"));
console.groupEnd();
</script>
</body>
</html>

0 comments on commit 13436eb

Please sign in to comment.