aboutsummaryrefslogtreecommitdiffstats
path: root/.config/pretest.js
diff options
context:
space:
mode:
Diffstat (limited to '.config/pretest.js')
-rw-r--r--.config/pretest.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/.config/pretest.js b/.config/pretest.js
new file mode 100644
index 0000000..1ccaf89
--- /dev/null
+++ b/.config/pretest.js
@@ -0,0 +1,20 @@
+'use strict'
+
+function get(uri) {
+ var xhr = new XMLHttpRequest()
+ xhr.open('GET', uri, false)
+ xhr.send()
+ if(xhr.status !== 200)
+ console.error('SVG.js fixture could not be loaded. Tests will fail.')
+ return xhr.responseText
+}
+
+function main() {
+ var style = document.createElement("style")
+ document.head.appendChild(style)
+ style.sheet.insertRule( get('/base/spec/fixture.css'), 0 )
+
+ document.body.innerHTML = get('/base/spec/fixture.svg')
+}
+
+main()