feat: 导入 NMEA-0183 GPS 协议解析库(node-nmea)
NMEA-0183 语句解析器,含 21 个语句类型 codec 与配套单元测试。 - codecs/:APB/BWC/DBT/GGA/GLL/GRMT/GSA/GSV/HDG/HDM/HDT/MWV/RDID/ RMB/RMC/ROT/RSA/TXT/VTG/VWR/ZDA - test/:各 codec 对应的 mocha 用例 - .github/workflows/:node与 npm-publish 流水线 许可证:MIT(原作者 James Penn)
This commit is contained in:
22
test/helperstest.js
Normal file
22
test/helperstest.js
Normal file
@@ -0,0 +1,22 @@
|
||||
var should = require('should');
|
||||
|
||||
describe('helpers ', function () {
|
||||
|
||||
it('padLeft', function () {
|
||||
var msg = require("../helpers.js").padLeft("abc", 5, " ");
|
||||
msg.should.equal(" abc");
|
||||
});
|
||||
|
||||
it('parseDateTime', function () {
|
||||
// Input = 3rd of April of 2005
|
||||
var dt = require("../helpers.js").parseDateTime("030405", "112233");
|
||||
(+dt.getUTCDate()).should.equal(3);
|
||||
(+dt.getUTCMonth() + 1).should.equal(4);
|
||||
(+dt.getUTCFullYear()).should.equal(2005);
|
||||
(+dt.getUTCHours()).should.equal(11);
|
||||
(+dt.getUTCMinutes()).should.equal(22);
|
||||
(+dt.getUTCSeconds()).should.equal(33);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user