mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
added simple test case (mocha)
This commit is contained in:
parent
ea9d093f0d
commit
08c7a84407
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
@ -17,6 +17,12 @@
|
|||||||
"Faisal Salman <fyzlman@gmail.com>"
|
"Faisal Salman <fyzlman@gmail.com>"
|
||||||
],
|
],
|
||||||
"main": "ua-parser",
|
"main": "ua-parser",
|
||||||
|
"scripts": {
|
||||||
|
"test": "./node_modules/mocha/bin/mocha"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"mocha": ">= 1.7.1"
|
||||||
|
},
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
10
test.js
Normal file
10
test.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
var assert = require("assert");
|
||||||
|
var UAParser = require("./ua-parser");
|
||||||
|
|
||||||
|
describe('getDevice', function () {
|
||||||
|
it('should return the model', function () {
|
||||||
|
var parser = new UAParser('Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11 (KHTML, like Gecko) Version/7.1.0.7 Safari/534.11');
|
||||||
|
var device = parser.getDevice();
|
||||||
|
assert.equal(device.model, "PlayBook");
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user