Skip to content

Commit

Permalink
add deleted test to test types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbakse committed Feb 1, 2022
1 parent 7a474ac commit 15e8882
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/examples/test_types/index.js
Expand Up @@ -30,6 +30,8 @@ function setup() {
shared.set = new Set([1, 2, 3]);
shared.undefined = "temp";
shared.undefined = undefined;
shared.deleted = "temp";
delete shared.deleted;

// unsupported types
shared.function = () => {
Expand Down Expand Up @@ -70,6 +72,8 @@ function setup() {
test("color", blue(c), blue(color("red")));

test("undefineds are stripped", shared.undefined, undefined);
test("undefineds are stripped", "undefined" in shared, false);
test("deleted properties are stripped", "deleted" in shared, false);

console.log("");
console.log("UNSUPPORTED");
Expand All @@ -81,9 +85,9 @@ function setup() {

function test(name, value, expected) {
if (same(value, expected)) {
console.log(`%c${name} passed`, "color: green", value, expected);
console.log(`%c${name}: passed`, "color: green", value, expected);
} else {
console.log(`%c${name} failed`, "color: red", value, expected);
console.log(`%c${name}: failed`, "color: red", value, expected);
}
}

Expand Down

0 comments on commit 15e8882

Please sign in to comment.