-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
277 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,44 @@ | ||
/* eslint-disable unicorn/filename-case */ | ||
/* eslint-disable unicorn/filename-case, eslint-comments/disable-enable-pair */ | ||
|
||
import * as assert from "assert"; | ||
import * as assert from 'node:assert' | ||
import { unlink } from 'node:fs' | ||
|
||
import { unlink } from "fs"; | ||
import { parkingDB_testing, nhtsaDB_testing } from '../data/databasePaths.js' | ||
import { initNHTSADB } from '../database/nhtsaDB/initializeDatabase.js' | ||
import { initializeDatabase as initializeParkingDatabase } from '../database/parkingDB/initializeDatabase.js' | ||
|
||
import { parkingDB_testing, nhtsaDB_testing } from "../data/databasePaths.js"; | ||
import { initializeDatabase as initializeParkingDatabase } from "../database/parkingDB/initializeDatabase.js"; | ||
import { initNHTSADB } from "../database/initializeDatabase.js"; | ||
|
||
describe("Reinitialize " + parkingDB_testing, () => { | ||
|
||
it("Purges " + parkingDB_testing, (done) => { | ||
describe('Reinitialize ' + parkingDB_testing, () => { | ||
it('Purges ' + parkingDB_testing, (done) => { | ||
unlink(parkingDB_testing, (error) => { | ||
if (error) { | ||
assert.fail() | ||
} else { | ||
assert.ok(true); | ||
assert.ok(true) | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
||
it("Creates " + parkingDB_testing, () => { | ||
const success = initializeParkingDatabase(); | ||
assert.ok(success); | ||
}); | ||
}); | ||
|
||
describe("Reinitialize " + nhtsaDB_testing, () => { | ||
|
||
it("Purges " + nhtsaDB_testing, (done) => { | ||
done() | ||
}) | ||
}) | ||
|
||
it('Creates ' + parkingDB_testing, () => { | ||
const success = initializeParkingDatabase() | ||
assert.ok(success) | ||
}) | ||
}) | ||
|
||
describe('Reinitialize ' + nhtsaDB_testing, () => { | ||
it('Purges ' + nhtsaDB_testing, (done) => { | ||
unlink(nhtsaDB_testing, (error) => { | ||
if (error) { | ||
assert.fail() | ||
} else { | ||
assert.ok(true); | ||
assert.ok(true) | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
||
it("Creates " + nhtsaDB_testing, () => { | ||
const success = initNHTSADB(); | ||
assert.ok(success); | ||
}); | ||
}); | ||
done() | ||
}) | ||
}) | ||
|
||
it('Creates ' + nhtsaDB_testing, () => { | ||
const success = initNHTSADB() | ||
assert.ok(success) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import * as assert from "assert"; | ||
import * as configFunctions from "../helpers/functions.config.js"; | ||
describe("helpers/configFunctions", () => { | ||
describe("#getProperty", () => { | ||
it("should include string value for property \"parkingTickets.ticketNumber.fieldLabel\"", () => { | ||
assert.strictEqual(typeof configFunctions.getProperty("parkingTickets.ticketNumber.fieldLabel"), "string"); | ||
import * as assert from 'node:assert'; | ||
import * as configFunctions from '../helpers/functions.config.js'; | ||
describe('helpers/configFunctions', () => { | ||
describe('#getProperty', () => { | ||
it('should include string value for property "parkingTickets.ticketNumber.fieldLabel"', () => { | ||
assert.strictEqual(typeof configFunctions.getProperty('parkingTickets.ticketNumber.fieldLabel'), 'string'); | ||
}); | ||
it("should return a string from function property \"parkingTickets.ticketNumber.nextTicketNumberFn\"", () => { | ||
assert.strictEqual(typeof configFunctions.getProperty("parkingTickets.ticketNumber.nextTicketNumberFn")(""), "string"); | ||
it('should return a string from function property "parkingTickets.ticketNumber.nextTicketNumberFn"', () => { | ||
assert.strictEqual(typeof configFunctions.getProperty('parkingTickets.ticketNumber.nextTicketNumberFn')(''), 'string'); | ||
}); | ||
}); | ||
describe("#getParkingTicketStatus()", () => { | ||
it("should include a ticket status \"paid\"", () => { | ||
assert.ok(configFunctions.getParkingTicketStatus("paid")); | ||
describe('#getParkingTicketStatus()', () => { | ||
it('should include a ticket status "paid"', () => { | ||
assert.ok(configFunctions.getParkingTicketStatus('paid')); | ||
}); | ||
}); | ||
describe("#getLicencePlateLocationProperties()", () => { | ||
it("should include the location \"CA\", \"ON\"", () => { | ||
assert.strictEqual(configFunctions.getLicencePlateLocationProperties("CA", "ON").licencePlateProvinceAlias, "Ontario"); | ||
describe('#getLicencePlateLocationProperties()', () => { | ||
it('should include the location "CA", "ON"', () => { | ||
assert.strictEqual(configFunctions.getLicencePlateLocationProperties('CA', 'ON') | ||
.licencePlateProvinceAlias, 'Ontario'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
/* eslint-disable unicorn/filename-case */ | ||
|
||
import * as assert from "assert"; | ||
|
||
import * as configFunctions from "../helpers/functions.config.js"; | ||
|
||
|
||
describe("helpers/configFunctions", () => { | ||
|
||
describe("#getProperty", () => { | ||
it("should include string value for property \"parkingTickets.ticketNumber.fieldLabel\"", () => { | ||
assert.strictEqual(typeof configFunctions.getProperty("parkingTickets.ticketNumber.fieldLabel"), "string"); | ||
}); | ||
|
||
it("should return a string from function property \"parkingTickets.ticketNumber.nextTicketNumberFn\"", () => { | ||
assert.strictEqual(typeof configFunctions.getProperty("parkingTickets.ticketNumber.nextTicketNumberFn")(""), "string"); | ||
}); | ||
|
||
|
||
}); | ||
|
||
describe("#getParkingTicketStatus()", () => { | ||
it("should include a ticket status \"paid\"", () => { | ||
assert.ok(configFunctions.getParkingTicketStatus("paid")); | ||
}); | ||
}); | ||
|
||
describe("#getLicencePlateLocationProperties()", () => { | ||
it("should include the location \"CA\", \"ON\"", () => { | ||
assert.strictEqual(configFunctions.getLicencePlateLocationProperties("CA", "ON").licencePlateProvinceAlias, "Ontario"); | ||
}); | ||
}); | ||
}); | ||
/* eslint-disable unicorn/filename-case, eslint-comments/disable-enable-pair */ | ||
|
||
import * as assert from 'node:assert' | ||
|
||
import * as configFunctions from '../helpers/functions.config.js' | ||
|
||
describe('helpers/configFunctions', () => { | ||
describe('#getProperty', () => { | ||
it('should include string value for property "parkingTickets.ticketNumber.fieldLabel"', () => { | ||
assert.strictEqual( | ||
typeof configFunctions.getProperty( | ||
'parkingTickets.ticketNumber.fieldLabel' | ||
), | ||
'string' | ||
) | ||
}) | ||
|
||
it('should return a string from function property "parkingTickets.ticketNumber.nextTicketNumberFn"', () => { | ||
assert.strictEqual( | ||
typeof configFunctions.getProperty( | ||
'parkingTickets.ticketNumber.nextTicketNumberFn' | ||
)(''), | ||
'string' | ||
) | ||
}) | ||
}) | ||
|
||
describe('#getParkingTicketStatus()', () => { | ||
it('should include a ticket status "paid"', () => { | ||
assert.ok(configFunctions.getParkingTicketStatus('paid')) | ||
}) | ||
}) | ||
|
||
describe('#getLicencePlateLocationProperties()', () => { | ||
it('should include the location "CA", "ON"', () => { | ||
assert.strictEqual( | ||
configFunctions.getLicencePlateLocationProperties('CA', 'ON') | ||
.licencePlateProvinceAlias, | ||
'Ontario' | ||
) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.