From 1928c62ffe255c3a2a89d31d7e8bf69035b1babb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 19 Oct 2015 18:44:07 -0400 Subject: stub sdk loader for test suite --- StoneIsland/www/js/sdk/auth.js | 4 ++-- test/lib/sdk.js | 22 ++++++++++++++++++++++ test/package.json | 15 +++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 test/lib/sdk.js create mode 100644 test/package.json diff --git a/StoneIsland/www/js/sdk/auth.js b/StoneIsland/www/js/sdk/auth.js index 29bc78f2..71e9e2d0 100644 --- a/StoneIsland/www/js/sdk/auth.js +++ b/StoneIsland/www/js/sdk/auth.js @@ -16,7 +16,7 @@ var auth = (function(){ auth.access_token = "" auth.user_id = -1 - auth.name = name + auth.name = "" // ios: integrate keychain api // android: cordova.file.externalRootDirectory api @@ -32,4 +32,4 @@ var auth = (function(){ } return auth -})() \ No newline at end of file +})() diff --git a/test/lib/sdk.js b/test/lib/sdk.js new file mode 100644 index 00000000..f1ae8f4c --- /dev/null +++ b/test/lib/sdk.js @@ -0,0 +1,22 @@ +var najax = require('najax') +var fs = require('fs') +var path = require('path') + +// hacky dummy jquery +var $ = { + ajax: najax, + ajaxSetup: function(){}, +} + +var is_iphone = true + +var files = "_sdk.js auth.js account.js address.js cart.js payment.js product.js shipping.js".split(" ") + +for (var i = 0; i < files.length; i++) { + var fn = path.join(__dirname, "../../StoneIsland/www/js/sdk/", files[i]) + console.log(fn) + eval( fs.readFileSync(fn) + '' ) +} + +module.exports = sdk + diff --git a/test/package.json b/test/package.json new file mode 100644 index 00000000..6d6df943 --- /dev/null +++ b/test/package.json @@ -0,0 +1,15 @@ +{ + "name": "stone-island-sdk-test", + "version": "1.0.0", + "description": "stone island sdk test", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "okfocus", + "license": "LNT", + "dependencies": { + "jquery": "^2.1.4", + "najax": "^0.2.1" + } +} -- cgit v1.2.3-70-g09d2