Skip to content

Commit

Permalink
Property definition testing (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Aug 21, 2018
1 parent 6a817f4 commit ad19ce4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/serial/property.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use strict";

describe("serial/property", function () {

if (gpf.internals) {

var _gpfSerialPropertyCheck = gpf.internals._gpfSerialPropertyCheck;

describe("_gpfSerialPropertyCheck", function () {

it("validates name", {
var exceptionCaught;
_gpfSerialPropertyCheck({
name: "OK"
});
assert(!exceptionCaught);
});

[
undefined,
0,
1,
{},
new Date(),
true,
false,
"",
"123"
].forEach(function (invalidName) {
it("rejects invalid names (" + JSON.stringify(invalidName) + ")", function () {
var exceptionCaught;
_gpfSerialPropertyCheck({
name: invalidName
});
assert(exceptionCaught instanceof gpf.Error.InvalidSerialName);
});
});

});

};

});

0 comments on commit ad19ce4

Please sign in to comment.