aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932014-10-27 19:54:02 +0000
committermrmr19932014-10-29 20:25:53 +0000
commit1bba5d27ab548b2a05e987695653ecf07cdb337c (patch)
tree5a2cc15ad8d77bab90c6200da4e50c46d6a2a25a
parent51b3924db3f3f683fd8a375e1b21077cae8b943e (diff)
downloadvimium-1bba5d27ab548b2a05e987695653ecf07cdb337c.tar.bz2
Fix tests
-rw-r--r--tests/unit_tests/commands_test.coffee5
-rw-r--r--tests/unit_tests/exclusion_test.coffee4
-rw-r--r--tests/unit_tests/settings_test.coffee2
-rw-r--r--tests/unit_tests/test_chrome_stubs.coffee9
-rw-r--r--tests/unit_tests/utils_test.coffee2
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee
index c10c643b..daaef016 100644
--- a/tests/unit_tests/commands_test.coffee
+++ b/tests/unit_tests/commands_test.coffee
@@ -1,8 +1,5 @@
-root.chrome =
- session:
- MAX_SESSION_RESULTS: 25
-
require "./test_helper.js"
+extend global, require "./test_chrome_stubs.js"
{Commands} = require "../../background_scripts/commands.js"
context "Key mappings",
diff --git a/tests/unit_tests/exclusion_test.coffee b/tests/unit_tests/exclusion_test.coffee
index a24c3b67..25bd8125 100644
--- a/tests/unit_tests/exclusion_test.coffee
+++ b/tests/unit_tests/exclusion_test.coffee
@@ -1,13 +1,13 @@
require "./test_helper.js"
-require "./test_chrome_stubs.js"
+extend global, require "./test_chrome_stubs.js"
# FIXME:
# Would like to do:
# extend(global, require "../../background_scripts/marks.js")
# But it looks like marks.coffee has never been included in a test before!
# Temporary fix...
-root.Marks =
+root.Marks =
create: () -> true
goto:
bind: () -> true
diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee
index 1283497c..4625457b 100644
--- a/tests/unit_tests/settings_test.coffee
+++ b/tests/unit_tests/settings_test.coffee
@@ -1,5 +1,5 @@
require "./test_helper.js"
-require "./test_chrome_stubs.js"
+extend global, require "./test_chrome_stubs.js"
extend(global, require "../../lib/utils.js")
Utils.getCurrentVersion = -> '1.44'
diff --git a/tests/unit_tests/test_chrome_stubs.coffee b/tests/unit_tests/test_chrome_stubs.coffee
index 9622f85f..2abd26c9 100644
--- a/tests/unit_tests/test_chrome_stubs.coffee
+++ b/tests/unit_tests/test_chrome_stubs.coffee
@@ -5,10 +5,10 @@
# It also provides stubs for a number of other chrome APIs.
#
-global.window = {}
-global.localStorage = {}
+exports.window = {}
+exports.localStorage = {}
-global.chrome =
+exports.chrome =
runtime:
getManifest: () ->
version: "1.2.3"
@@ -56,6 +56,9 @@ global.chrome =
items[key] = {}
@func(items,'synced storage stub')
+ session:
+ MAX_SESSION_RESULTS: 25
+
# chrome.storage.sync
sync:
store: {}
diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee
index c4139dbb..76a023ed 100644
--- a/tests/unit_tests/utils_test.coffee
+++ b/tests/unit_tests/utils_test.coffee
@@ -1,5 +1,5 @@
require "./test_helper.js"
-require "./test_chrome_stubs.js"
+extend global, require "./test_chrome_stubs.js"
extend(global, require "../../lib/utils.js")
Utils.getCurrentVersion = -> '1.43'
extend(global, require "../../background_scripts/sync.js")