jquery-csv
Advanced tools
Comparing version 0.8.4 to 0.8.5
{ | ||
"name": "jquery-csv", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"description": "A jQuery CSV parser plugin. Battle Tested | Optimized | 100% IETF RFC 4180 Complete", | ||
@@ -11,2 +11,3 @@ "author": { | ||
"devDependencies": { | ||
"browserify": "^15.2.0", | ||
"chai": "^4.0", | ||
@@ -18,3 +19,6 @@ "grunt": "^1.0", | ||
"jquery": "^3.0", | ||
"mocha": "^4.0" | ||
"mocha": "^4.0", | ||
"mocha-phantomjs": "^4.1.0", | ||
"promise-polyfill": "^7.0.0", | ||
"whatwg-fetch": "^2.0.3" | ||
}, | ||
@@ -26,4 +30,5 @@ "main": "src/jquery.csv.js", | ||
"scripts": { | ||
"test": "test-node", | ||
"test-node": "mocha test/test.js", | ||
"test": "npm run test-node", | ||
"test-node": "npx mocha test/test.js", | ||
"test-browser": "npx mocha-phantomjs test/test.html", | ||
"grunt": "npx grunt --force" | ||
@@ -30,0 +35,0 @@ }, |
@@ -1,14 +0,29 @@ | ||
var fs = require('fs'); | ||
(function (undefined) { | ||
'use strict'; | ||
function csvFixture(fixtureName) { | ||
return fs.readFileSync('./test/fixtures/' + fixtureName + '.csv', 'utf8'); | ||
if (!this.window) { | ||
var fs = require('fs'); | ||
var csvFixture = function(fixtureName) { | ||
return fs.readFileSync('./test/fixtures/' + fixtureName + '.csv', 'utf8'); | ||
} | ||
var jsonFixture = function(fixtureName) { | ||
return JSON.parse(fs.readFileSync('./test/fixtures/' + fixtureName + '.json')); | ||
} | ||
} | ||
function jsonFixture(fixtureName) { | ||
return JSON.parse(fs.readFileSync('./test/fixtures/' + fixtureName + '.json')); | ||
if (this.window) { | ||
var csvFixture = function(fixtureName) { | ||
return fetch('./test/fixtures/' + fixtureName + '.csv', { method: 'GET', body: 'text/plain' }) | ||
.then(function(response) { | ||
console.log(response); | ||
return response; | ||
}); | ||
} | ||
var jsonFixture = function(fixtureName) { | ||
return fetch('./test/fixtures/' + fixtureName + '.json', { method: 'GET', body: 'application/json' }) | ||
.then(function(response) { | ||
return JSON.parse(response); | ||
}); | ||
} | ||
} | ||
var fixtures = { | ||
@@ -15,0 +30,0 @@ array_csv: csvFixture('array'), |
@@ -0,8 +1,12 @@ | ||
if (!this.window) { | ||
var assert = require('chai').assert; | ||
var expect = require('chai').expect; | ||
var should = require('chai').should(); | ||
var csv = require('../src/jquery.csv.js'); | ||
var fixtures = require('./fixtures/fixtures.js'); | ||
} | ||
console.log($); | ||
console.log(fixtures); | ||
describe('core:', function () { | ||
@@ -9,0 +13,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198959
1537
11
3