@jbrowse/plugin-legacy-jbrowse 2.3.2 → 2.3.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-legacy-jbrowse",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "JBrowse 2 plugin for connecting to and reading JBrowse 1 data",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -48,7 +48,7 @@
48
48
  "mobx": "^6.0.0",
49
49
  "mobx-react": "^7.0.0",
50
50
  "mobx-state-tree": "^5.0.0",
51
- "rxjs": "^6.0.0"
51
+ "rxjs": "^7.0.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -56,5 +56,5 @@
56
56
  "distModule": "esm/index.js",
57
57
  "srcModule": "src/index.ts",
58
58
  "module": "esm/index.js",
59
- "gitHead": "467d973535bb7b2664e9f66311fb0dc21c1ce5ba"
59
+ "gitHead": "98ae48be91ee2371e1b2768a907b4997995e9915"
60
60
  }
@@ -1,8 +1,9 @@
1
1
  import { toArray } from 'rxjs/operators'
2
2
  import path from 'path'
3
+ import { LocalFile, GenericFilehandle } from 'generic-filehandle'
4
+ import { firstValueFrom } from 'rxjs'
3
5
  import Adapter from './NCListAdapter'
4
6
  import configSchema from './configSchema'
5
- import { LocalFile, GenericFilehandle } from 'generic-filehandle'
6
7
 
7
8
  export function generateReadBuffer(
8
9
  getFileFunction: (str: string) => GenericFilehandle,
@@ -42,12 +43,12 @@ test('adapter can fetch features from ensembl_genes test set', async () => {
42
43
  end: 35960388,
43
44
  })
44
45
 
45
- const featuresArray = await features.pipe(toArray()).toPromise()
46
- expect(featuresArray[0].get('refName')).toBe('21')
47
- expect(featuresArray[0].id()).toBe(`test-21,0,0,19,22,0`)
48
- const featuresJsonArray = featuresArray.map(f => f.toJSON())
49
- expect(featuresJsonArray.length).toEqual(94)
50
- for (const feature of featuresJsonArray) {
46
+ const featArr = await firstValueFrom(features.pipe(toArray()))
47
+ expect(featArr[0].get('refName')).toBe('21')
48
+ expect(featArr[0].id()).toBe(`test-21,0,0,19,22,0`)
49
+ const featJson = featArr.map(f => f.toJSON())
50
+ expect(featJson.length).toEqual(94)
51
+ for (const feature of featJson) {
51
52
  expect(feature).toMatchSnapshot({ uniqueId: expect.any(String) })
52
53
  }
53
54
 
@@ -0,0 +1,35 @@
1
+ import PluginManager from '@jbrowse/core/PluginManager'
2
+ import { getSnapshot } from 'mobx-state-tree'
3
+ import ThisPlugin from '.'
4
+
5
+ test('plugin in a stock JBrowse', () => {
6
+ const pm = new PluginManager([new ThisPlugin()])
7
+ pm.createPluggableElements()
8
+ pm.configure()
9
+ expect(() => pm.addPlugin(new ThisPlugin())).toThrow(
10
+ /JBrowse already configured, cannot add plugins/,
11
+ )
12
+
13
+ const NCListAdapter = pm.getAdapterType('NCListAdapter')
14
+ const config = NCListAdapter.configSchema.create({ type: 'NCListAdapter' })
15
+ expect(getSnapshot(config)).toMatchSnapshot()
16
+ })
17
+
18
+ test('test creating a text search adapter', () => {
19
+ const pm = new PluginManager([new ThisPlugin()])
20
+ pm.createPluggableElements()
21
+ pm.configure()
22
+
23
+ const Adapter = pm.getTextSearchAdapterType('JBrowse1TextSearchAdapter')
24
+ const config = Adapter.configSchema.create({
25
+ type: 'JBrowse1TextSearchAdapter',
26
+ textSearchAdapterId: 'JBrowse1GenerateNamesAdapterTest',
27
+ namesIndexLocation: {
28
+ uri: 'names/',
29
+ locationType: 'UriLocation',
30
+ },
31
+ tracks: [],
32
+ assemblies: [],
33
+ })
34
+ expect(getSnapshot(config)).toMatchSnapshot()
35
+ })
package/src/declare.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module '@gmod/nclist'
package/src/index.test.js DELETED
@@ -1,41 +0,0 @@
1
- import PluginManager from '@jbrowse/core/PluginManager'
2
- import { getSnapshot } from 'mobx-state-tree'
3
- import ThisPlugin from '.'
4
-
5
- test('plugin in a stock JBrowse', () => {
6
- const originalConsoleWarn = console.warn
7
- console.warn = jest.fn()
8
- const pluginManager = new PluginManager([new ThisPlugin()])
9
- pluginManager.createPluggableElements()
10
- pluginManager.configure()
11
- console.warn = originalConsoleWarn
12
- expect(() => pluginManager.addPlugin(new ThisPlugin())).toThrow(
13
- /JBrowse already configured, cannot add plugins/,
14
- )
15
-
16
- const NCListAdapter = pluginManager.getAdapterType('NCListAdapter')
17
- const config = NCListAdapter.configSchema.create({ type: 'NCListAdapter' })
18
- expect(getSnapshot(config)).toMatchSnapshot()
19
- })
20
-
21
- test('test creating a text search adapter', () => {
22
- console.warn = jest.fn()
23
- const pluginManager = new PluginManager([new ThisPlugin()])
24
- pluginManager.createPluggableElements()
25
- pluginManager.configure()
26
-
27
- const JB1TextSearchAdapter = pluginManager.getTextSearchAdapterType(
28
- 'JBrowse1TextSearchAdapter',
29
- )
30
- const config = JB1TextSearchAdapter.configSchema.create({
31
- type: 'JBrowse1TextSearchAdapter',
32
- textSearchAdapterId: 'JBrowse1GenerateNamesAdapterTest',
33
- namesIndexLocation: {
34
- uri: 'names/',
35
- locationType: 'UriLocation',
36
- },
37
- tracks: [],
38
- assemblies: [],
39
- })
40
- expect(getSnapshot(config)).toMatchSnapshot()
41
- })