Tests for .valueAsNumber with <input type=month>.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS valueAsNumberFor("") is Number.NaN
PASS valueAsNumberFor("1969-01") is -12
PASS valueAsNumberFor("1969-12") is -1
PASS valueAsNumberFor("1970-01") is 0
PASS valueAsNumberFor("1970-12") is 11
PASS valueAsNumberFor("1971-01") is 12
PASS valueAsNumberFor("2009-12") is (2009-1970)*12+11
PASS input.valueAsNumber = -1; input.value is "1969-12"
PASS input.valueAsNumber = 0; input.value is "1970-01"
PASS setValueAsNumberAndGetValue(2009, 12) is "2009-12"
PASS setValueAsNumberAndGetValue(10000, 1) is "10000-01"
PASS setValueAsNumberAndGetValue(-1, 1) is ""
PASS setValueAsNumberAndGetValue(0, 12) is ""
PASS setValueAsNumberAndGetValue(1, 1) is "0001-01"
PASS setValueAsNumberAndGetValue(1, 2) is "0001-02"
PASS setValueAsNumberAndGetValue(275760, 9) is "275760-09"
PASS setValueAsNumberAndGetValue(275760, 10) is ""
Tests to set invalid values to valueAsNumber:
PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-01"
PASS input.valueAsNumber = "foo"; input.valueAsNumber is NaN
PASS input.valueAsNumber = "foo"; input.value is ""
PASS input.valueAsNumber = NaN; input.valueAsNumber is NaN
PASS input.valueAsNumber = NaN; input.value is ""
PASS input.valueAsNumber = Number.NaN; input.valueAsNumber is NaN
PASS input.valueAsNumber = Number.NaN; input.value is ""
PASS input.valueAsNumber = Infinity threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception TypeError: Failed to set the 'valueAsNumber' property on 'HTMLInputElement': The value provided is infinite..
PASS successfullyParsed is true
TEST COMPLETE