mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Moved tests to spec folder with jasmine configuration
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"description": "The easiest way to generate custom Apple Wallet passes in Node.js",
|
"description": "The easiest way to generate custom Apple Wallet passes in Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jasmine tests/index.js"
|
"test": "jasmine spec/index.js"
|
||||||
},
|
},
|
||||||
"author": "Alexander Patrick Cerutti",
|
"author": "Alexander Patrick Cerutti",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
6
spec/support/jasmine.json
Normal file
6
spec/support/jasmine.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"spec_dir": "spec",
|
||||||
|
"spec_files": [ "**/index.js" ],
|
||||||
|
"stopSpecOnExpectationFailure": false,
|
||||||
|
"random": true
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ const readdir = promisify(fs.readdir);
|
|||||||
const readFile = promisify(fs.readFile);
|
const readFile = promisify(fs.readFile);
|
||||||
|
|
||||||
const noop = () => { };
|
const noop = () => { };
|
||||||
|
const transitType = Symbol("transitType");
|
||||||
|
|
||||||
class Pass {
|
class Pass {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
@@ -38,7 +39,7 @@ class Pass {
|
|||||||
this._fields = ["primaryFields", "secondaryFields", "auxiliaryFields", "backFields", "headerFields"];
|
this._fields = ["primaryFields", "secondaryFields", "auxiliaryFields", "backFields", "headerFields"];
|
||||||
|
|
||||||
this._fields.forEach(a => this[a] = new FieldsArray());
|
this._fields.forEach(a => this[a] = new FieldsArray());
|
||||||
this._transitType = "";
|
this[transitType] = "";
|
||||||
|
|
||||||
// Assigning model and _props to this
|
// Assigning model and _props to this
|
||||||
Object.assign(this, this._parseSettings(options));
|
Object.assign(this, this._parseSettings(options));
|
||||||
@@ -692,15 +693,15 @@ class Pass {
|
|||||||
|
|
||||||
set transitType(v) {
|
set transitType(v) {
|
||||||
if (schema.isValid(v, "transitType")) {
|
if (schema.isValid(v, "transitType")) {
|
||||||
this._transitType = v;
|
this[transitType] = v;
|
||||||
} else {
|
} else {
|
||||||
genericDebug(formatMessage("TRSTYPE_NOT_VALID", v));
|
genericDebug(formatMessage("TRSTYPE_NOT_VALID", v));
|
||||||
this._transitType = this._transitType || "";
|
this[transitType] = this[transitType] || "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get transitType() {
|
get transitType() {
|
||||||
return this._transitType;
|
return this[transitType];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user