@jbrowse/plugin-legacy-jbrowse 2.0.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/JBrowse1Connection/configSchema.js +2 -2
  2. package/dist/JBrowse1Connection/configSchema.js.map +1 -1
  3. package/dist/JBrowse1Connection/jb1ConfigLoad.js +132 -285
  4. package/dist/JBrowse1Connection/jb1ConfigLoad.js.map +1 -1
  5. package/dist/JBrowse1Connection/jb1ConfigParse.js +58 -127
  6. package/dist/JBrowse1Connection/jb1ConfigParse.js.map +1 -1
  7. package/dist/JBrowse1Connection/jb1ToJb2.js +155 -159
  8. package/dist/JBrowse1Connection/jb1ToJb2.js.map +1 -1
  9. package/dist/JBrowse1Connection/model.js +20 -20
  10. package/dist/JBrowse1Connection/model.js.map +1 -1
  11. package/dist/JBrowse1Connection/util.js +18 -41
  12. package/dist/JBrowse1Connection/util.js.map +1 -1
  13. package/dist/JBrowse1TextSeachAdapter/HttpMap.js +58 -168
  14. package/dist/JBrowse1TextSeachAdapter/HttpMap.js.map +1 -1
  15. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +48 -145
  16. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js.map +1 -1
  17. package/dist/JBrowse1TextSeachAdapter/configSchema.js +1 -1
  18. package/dist/JBrowse1TextSeachAdapter/configSchema.js.map +1 -1
  19. package/dist/NCListAdapter/NCListAdapter.js +38 -147
  20. package/dist/NCListAdapter/NCListAdapter.js.map +1 -1
  21. package/dist/NCListAdapter/NCListFeature.js +35 -39
  22. package/dist/NCListAdapter/NCListFeature.js.map +1 -1
  23. package/dist/NCListAdapter/configSchema.js +1 -1
  24. package/dist/NCListAdapter/configSchema.js.map +1 -1
  25. package/dist/index.js +39 -65
  26. package/dist/index.js.map +1 -1
  27. package/package.json +4 -5
  28. package/src/NCListAdapter/NCListAdapter.test.ts +24 -16
@@ -1,27 +1,35 @@
1
- import { promises as fsPromises } from 'fs'
2
- import path from 'path'
3
- import { URL } from 'url'
4
1
  import { toArray } from 'rxjs/operators'
2
+ import path from 'path'
5
3
  import Adapter from './NCListAdapter'
6
4
  import configSchema from './configSchema'
5
+ import { LocalFile, GenericFilehandle } from 'generic-filehandle'
6
+
7
+ export function generateReadBuffer(
8
+ getFileFunction: (str: string) => GenericFilehandle,
9
+ ) {
10
+ return (request: Request) => {
11
+ const file = getFileFunction(request.url)
12
+ return file.readFile('utf8')
13
+ }
14
+ }
15
+
16
+ beforeEach(() => {
17
+ // @ts-ignore
18
+ fetch.resetMocks()
19
+ // @ts-ignore
20
+ fetch.mockResponse(
21
+ generateReadBuffer(
22
+ (url: string) =>
23
+ new LocalFile(path.join(__dirname, `../../test_data/${url}`)),
24
+ ),
25
+ )
26
+ })
7
27
 
8
28
  test('adapter can fetch features from ensembl_genes test set', async () => {
9
- const rootTemplate = path
10
- .join(
11
- __dirname,
12
- '..',
13
- '..',
14
- 'test_data',
15
- 'ensembl_genes',
16
- '{refseq}',
17
- 'trackData.json',
18
- )
19
- .replace(/\\/g, '\\\\')
20
- await fsPromises.stat(rootTemplate.replace('{refseq}', '21')) // will throw if doesnt exist
21
29
  const args = {
22
30
  refNames: [],
23
31
  rootUrlTemplate: {
24
- uri: decodeURI(new URL(`file://${rootTemplate}`).href),
32
+ uri: 'ensembl_genes/{refseq}/trackData.json',
25
33
  locationType: 'UriLocation',
26
34
  },
27
35
  }