summaryrefslogtreecommitdiff
path: root/axios/test/specs/helpers/isURLSameOrigin.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'axios/test/specs/helpers/isURLSameOrigin.spec.js')
-rw-r--r--axios/test/specs/helpers/isURLSameOrigin.spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/axios/test/specs/helpers/isURLSameOrigin.spec.js b/axios/test/specs/helpers/isURLSameOrigin.spec.js
new file mode 100644
index 0000000..c26c770
--- /dev/null
+++ b/axios/test/specs/helpers/isURLSameOrigin.spec.js
@@ -0,0 +1,11 @@
+var isURLSameOrigin = require('../../../lib/helpers/isURLSameOrigin');
+
+describe('helpers::isURLSameOrigin', function () {
+ it('should detect same origin', function () {
+ expect(isURLSameOrigin(window.location.href)).toEqual(true);
+ });
+
+ it('should detect different origin', function () {
+ expect(isURLSameOrigin('https://github.com/axios/axios')).toEqual(false);
+ });
+});