summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-10-19 18:44:07 -0400
committerJules Laplace <jules@okfoc.us>2015-10-19 18:44:17 -0400
commit1928c62ffe255c3a2a89d31d7e8bf69035b1babb (patch)
tree5079b5d28ba6d41d4a888fdf364ab96befa612fc
parentacc37ef0a58ccf5a8b1bffa5ba115b1ec9f22c6b (diff)
stub sdk loader for test suite
-rw-r--r--StoneIsland/www/js/sdk/auth.js4
-rw-r--r--test/lib/sdk.js22
-rw-r--r--test/package.json15
3 files changed, 39 insertions, 2 deletions
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"
+ }
+}