pretest.js 494 B

123456789101112131415161718192021
  1. /* global XMLHttpRequest */
  2. 'use strict'
  3. function get (uri) {
  4. var xhr = new XMLHttpRequest()
  5. xhr.open('GET', uri, false)
  6. xhr.send()
  7. if (xhr.status !== 200) { console.error('SVG.js fixture could not be loaded. Tests will fail.') }
  8. return xhr.responseText
  9. }
  10. function main () {
  11. var style = document.createElement('style')
  12. document.head.appendChild(style)
  13. style.sheet.insertRule(get('/fixtures/fixture.css'), 0)
  14. document.body.innerHTML = get('/fixtures/fixture.svg')
  15. }
  16. main()