@into-cps-association/libms 0.3.1 → 0.4.0
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/.env +0 -3
- package/DEVELOPER.md +24 -7
- package/README.md +42 -43
- package/config/.env.default +6 -0
- package/config/http.json +30 -0
- package/dist/src/bootstrap.d.ts +1 -0
- package/dist/src/bootstrap.js +4 -0
- package/dist/src/bootstrap.js.map +1 -1
- package/dist/src/cloudcmd/cloudcmd.d.ts +3 -0
- package/dist/src/cloudcmd/cloudcmd.js +22 -0
- package/dist/src/cloudcmd/cloudcmd.js.map +1 -0
- package/dist/src/files/files.module.js +1 -7
- package/dist/src/files/files.module.js.map +1 -1
- package/dist/src/files/services/files-service.factory.d.ts +1 -3
- package/dist/src/files/services/files-service.factory.js +2 -10
- package/dist/src/files/services/files-service.factory.js.map +1 -1
- package/dist/src/files/services/local-files.service.js +2 -2
- package/dist/src/main.js +8 -8
- package/dist/src/main.js.map +1 -1
- package/dist/test/cloudcmd/cloudcmd.spec.js +35 -0
- package/dist/test/cloudcmd/cloudcmd.spec.js.map +1 -0
- package/dist/test/e2e/app.e2e.spec.js +27 -10
- package/dist/test/e2e/app.e2e.spec.js.map +1 -1
- package/dist/test/integration/files.service.integration.spec.js +1 -3
- package/dist/test/integration/files.service.integration.spec.js.map +1 -1
- package/dist/test/testUtil.js +1 -10
- package/dist/test/testUtil.js.map +1 -1
- package/dist/test/unit/files-service.factory.unit.spec.js +0 -8
- package/dist/test/unit/files-service.factory.unit.spec.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -27
- package/pm2.config.js +10 -0
- package/src/bootstrap.ts +8 -0
- package/src/cloudcmd/cloudcmd.ts +32 -0
- package/src/files/files.module.ts +1 -7
- package/src/files/services/files-service.factory.ts +0 -5
- package/src/files/services/local-files.service.ts +2 -2
- package/src/main.ts +12 -7
- package/test/cloudcmd/cloudcmd.spec.ts +52 -0
- package/test/coverage/clover.xml +14 -19
- package/test/coverage/coverage-final.json +1 -1
- package/test/coverage/lcov-report/base.css +261 -123
- package/test/coverage/lcov-report/index.html +13 -13
- package/test/coverage/lcov-report/prettify.css +101 -1
- package/test/coverage/lcov-report/testUtil.ts.html +8 -35
- package/test/coverage/lcov.info +10 -19
- package/test/e2e/app.e2e.spec.ts +42 -42
- package/test/integration/files.service.integration.spec.ts +1 -3
- package/test/testUtil.ts +1 -10
- package/test/unit/files-service.factory.unit.spec.ts +0 -9
- package/tsconfig.json +1 -1
- package/dist/src/files/queries.d.ts +0 -2
- package/dist/src/files/queries.js +0 -47
- package/dist/src/files/queries.js.map +0 -1
- package/dist/src/files/services/gitlab-files.service.d.ts +0 -12
- package/dist/src/files/services/gitlab-files.service.js +0 -65
- package/dist/src/files/services/gitlab-files.service.js.map +0 -1
- package/dist/test/unit/gitlab-files.service.unit.spec.js +0 -37
- package/dist/test/unit/gitlab-files.service.unit.spec.js.map +0 -1
- package/src/files/queries.ts +0 -42
- package/src/files/services/gitlab-files.service.ts +0 -65
- package/test/starttraefik.bash +0 -11
- package/test/stoptraefik.bash +0 -9
- package/test/unit/gitlab-files.service.unit.spec.ts +0 -46
- /package/dist/test/{unit/gitlab-files.service.unit.spec.d.ts → cloudcmd/cloudcmd.spec.d.ts} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
-
import { ConfigService } from '@nestjs/config';
|
|
3
|
-
import axios from 'axios';
|
|
4
|
-
import GitlabFilesService from '../../src/files/services/gitlab-files.service';
|
|
5
|
-
import {
|
|
6
|
-
pathToTestFileContent,
|
|
7
|
-
testFileContent,
|
|
8
|
-
MockConfigService,
|
|
9
|
-
testDirectory,
|
|
10
|
-
} from '../testUtil';
|
|
11
|
-
|
|
12
|
-
describe('GitlabFilesService', () => {
|
|
13
|
-
let filesService: GitlabFilesService;
|
|
14
|
-
const mockConfigService = new MockConfigService();
|
|
15
|
-
jest.mock('axios');
|
|
16
|
-
|
|
17
|
-
beforeEach(async () => {
|
|
18
|
-
const module: TestingModule = await Test.createTestingModule({
|
|
19
|
-
providers: [
|
|
20
|
-
GitlabFilesService,
|
|
21
|
-
{ provide: ConfigService, useValue: mockConfigService },
|
|
22
|
-
],
|
|
23
|
-
})
|
|
24
|
-
.overrideProvider(ConfigService)
|
|
25
|
-
.useValue(mockConfigService)
|
|
26
|
-
.compile();
|
|
27
|
-
|
|
28
|
-
filesService = module.get<GitlabFilesService>(GitlabFilesService);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should list directory', async () => {
|
|
32
|
-
jest.spyOn(axios, 'post').mockResolvedValue({ data: testDirectory });
|
|
33
|
-
|
|
34
|
-
const result = await filesService.listDirectory('user2');
|
|
35
|
-
expect(result).toEqual(testDirectory);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should read file', async () => {
|
|
39
|
-
jest
|
|
40
|
-
.spyOn(axios, 'post')
|
|
41
|
-
.mockResolvedValue({ data: { data: testFileContent } });
|
|
42
|
-
|
|
43
|
-
const result = await filesService.readFile(pathToTestFileContent);
|
|
44
|
-
expect(result).toEqual(testFileContent);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
File without changes
|