diff --git a/package.json b/package.json index 5183b2b057..7239196e41 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "check-format": "prettier --check .", "typecheck": "tsc --noEmit", "pretest-ci": "cd products/jbrowse-react-linear-genome-view;yarn build;cd ../../", - "test-ci": "cross-env NODE_OPTIONS='--max-old-space-size=7000' jest --ci --coverage && jest --testMatch '**/*testmod.js'", + "test-ci": "cross-env NODE_OPTIONS='--max-old-space-size=7000' jest --ci --coverage && jest --env node --testMatch '**/*testmod.js'", "built-test-ci": "jest --ci integration.test.js", "test": "jest" }, diff --git a/products/jbrowse-img/src/index.js b/products/jbrowse-img/src/index.js index 598a5817b5..631c0e2f8c 100644 --- a/products/jbrowse-img/src/index.js +++ b/products/jbrowse-img/src/index.js @@ -1,15 +1,17 @@ /* eslint-disable no-console */ import fs from 'fs' import yargs from 'yargs' -import jsdom from 'jsdom' import { standardizeArgv, parseArgv } from './parseArgv' import { renderRegion } from './renderRegion' import tmp from 'tmp' import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only' import { spawnSync } from 'child_process' import fetch, { Headers, Response, Request } from 'node-fetch' +import { JSDOM } from 'jsdom' + +const { document } = new JSDOM(`...`).window +global.document = document -global.document = jsdom.jsdom() if (!global.fetch) { global.fetch = fetch global.Headers = Headers diff --git a/products/jbrowse-img/src/index.testmod.js b/products/jbrowse-img/src/index.testmod.js index 3585181a14..42f2d6eaed 100644 --- a/products/jbrowse-img/src/index.testmod.js +++ b/products/jbrowse-img/src/index.testmod.js @@ -1,5 +1,10 @@ import { renderRegion } from './renderRegion' import fs from 'fs' +import { JSDOM } from 'jsdom' +import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only' + +const { document } = new JSDOM(`...`).window +global.document = document function hashCode(str) { let hash = 0 diff --git a/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam.svg b/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam.svg index e531857034..df7ddbdeae 100644 --- a/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam.svg +++ b/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam.svg @@ -1 +1 @@ -volvox.fa1KbpctgA1,0001,1001,2001,3001,4001,5001,6001,7001,8001,9002,000volvox-sorted.bam003535volvox-sorted.cram003535volvox-sorted.bam.coverage.bw00101020203030volvox.filtered.vcf.gzSNV T -> Cvolvox.sort.gff3.gzctgARemark:hgaGene:hgaProtein:HGAGene:hgbf07This is an exampleProtein:HGBb101.2Fingerprinted BAC with end readsFakeSNPThis is a fake SNP that should appear at 1000 with length 1agt830.5agt221.5EDENprotein kinaseagt767.5volvox.bbEDEN.1EDEN.2EDEN.3volvox-bed12.bed.gzEDEN.1EDEN.2EDEN.3 \ No newline at end of file +volvox.fa1KbpctgA1,0001,1001,2001,3001,4001,5001,6001,7001,8001,9002,000volvox-sorted.bam003535volvox-sorted.cram003535volvox-sorted.bam.coverage.bw00101020203030volvox.filtered.vcf.gzSNV T -> Cvolvox.sort.gff3.gzctgARemark:hgaGene:hgaProtein:HGAGene:hgbf07This is an exampleProtein:HGBb101.2Fingerprinted BAC with end readsFakeSNPThis is a fake SNP that should appear at 1000 with length 1agt830.5agt221.5EDENprotein kinaseagt767.5volvox.bbEDEN.1EDEN.2EDEN.3volvox-bed12.bed.gzEDEN.1EDEN.2EDEN.3 \ No newline at end of file diff --git a/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam_norasterize.svg b/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam_norasterize.svg index 3e9bc668d6..4cf67afc62 100644 --- a/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam_norasterize.svg +++ b/products/jbrowse-img/test/svg_from_volvox_fasta_and_bam_norasterize.svg @@ -1 +1 @@ -volvox.fa1KbpctgA1,0001,1001,2001,3001,4001,5001,6001,7001,8001,9002,000volvox-sorted.bam003535volvox-sorted.cram003535volvox-sorted.bam.coverage.bw00101020203030volvox.filtered.vcf.gzSNV T -> Cvolvox.sort.gff3.gzctgARemark:hgaGene:hgaProtein:HGAGene:hgbf07This is an exampleProtein:HGBb101.2Fingerprinted BAC with end readsFakeSNPThis is a fake SNP that should appear at 1000 with length 1agt830.5agt221.5EDENprotein kinaseagt767.5volvox.bbEDEN.1EDEN.2EDEN.3volvox-bed12.bed.gzEDEN.1EDEN.2EDEN.3 \ No newline at end of file +volvox.fa1KbpctgA1,0001,1001,2001,3001,4001,5001,6001,7001,8001,9002,000volvox-sorted.bam003535volvox-sorted.cram003535volvox-sorted.bam.coverage.bw00101020203030volvox.filtered.vcf.gzSNV T -> Cvolvox.sort.gff3.gzctgARemark:hgaGene:hgaProtein:HGAGene:hgbf07This is an exampleProtein:HGBb101.2Fingerprinted BAC with end readsFakeSNPThis is a fake SNP that should appear at 1000 with length 1agt830.5agt221.5EDENprotein kinaseagt767.5volvox.bbEDEN.1EDEN.2EDEN.3volvox-bed12.bed.gzEDEN.1EDEN.2EDEN.3 \ No newline at end of file