@verdaccio/store 6.0.0-6-next.20 → 6.0.0-6-next.21

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.
@@ -6,7 +6,6 @@ import { setup } from '@verdaccio/logger';
6
6
  import { configExample } from '@verdaccio/mock';
7
7
 
8
8
  import { Storage, removeDuplicates } from '../src';
9
- import { SearchInstance } from '../src/search';
10
9
 
11
10
  setup([]);
12
11
 
@@ -53,68 +52,4 @@ describe('search', () => {
53
52
  expect(results).toHaveLength(4);
54
53
  });
55
54
  });
56
-
57
- describe('search index', () => {
58
- const packages = [
59
- {
60
- name: 'test1',
61
- description: 'description',
62
- _npmUser: {
63
- name: 'test_user',
64
- },
65
- },
66
- {
67
- name: 'test2',
68
- description: 'description',
69
- _npmUser: {
70
- name: 'test_user',
71
- },
72
- },
73
- {
74
- name: 'test3',
75
- description: 'description',
76
- _npmUser: {
77
- name: 'test_user',
78
- },
79
- },
80
- ];
81
-
82
- test('search query item', async () => {
83
- const config = new Config(configExample());
84
- const storage = new Storage(config);
85
- await storage.init(config);
86
- SearchInstance.configureStorage(storage);
87
- packages.map(function (item) {
88
- // @ts-ignore
89
- SearchInstance.add(item);
90
- });
91
- const result = SearchInstance.query('t');
92
- expect(result).toHaveLength(3);
93
- });
94
-
95
- test('search remove item', async () => {
96
- const config = new Config(configExample());
97
- const storage = new Storage(config);
98
- await storage.init(config);
99
- SearchInstance.configureStorage(storage);
100
- packages.map(function (item) {
101
- // @ts-ignore
102
- SearchInstance.add(item);
103
- });
104
- const item = {
105
- name: 'test6',
106
- description: 'description',
107
- _npmUser: {
108
- name: 'test_user',
109
- },
110
- };
111
- // @ts-ignore
112
- SearchInstance.add(item);
113
- let result = SearchInstance.query('test6');
114
- expect(result).toHaveLength(1);
115
- SearchInstance.remove(item.name);
116
- result = SearchInstance.query('test6');
117
- expect(result).toHaveLength(0);
118
- });
119
- });
120
55
  });
@@ -3,9 +3,9 @@ import * as httpMocks from 'node-mocks-http';
3
3
 
4
4
  import { Config } from '@verdaccio/config';
5
5
  import { HEADERS, errorUtils } from '@verdaccio/core';
6
- import { generatePackageMetadata } from '@verdaccio/helper';
7
6
  import { setup } from '@verdaccio/logger';
8
7
  import { configExample, generateRamdonStorage } from '@verdaccio/mock';
8
+ import { generatePackageMetadata } from '@verdaccio/test-helper';
9
9
 
10
10
  import { Storage } from '../src';
11
11