@rosen-bridge/utils 0.0.1 → 0.1.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/CHANGELOG.md +7 -0
- package/dist/lib/downloadRosenAssets.d.ts +6 -3
- package/dist/lib/downloadRosenAssets.d.ts.map +1 -1
- package/dist/lib/downloadRosenAssets.js +14 -10
- package/dist/lib/downloadTssBinary.d.ts +13 -0
- package/dist/lib/downloadTssBinary.d.ts.map +1 -0
- package/dist/lib/downloadTssBinary.js +45 -0
- package/dist/lib/utils/github.d.ts +99 -1
- package/dist/lib/utils/github.d.ts.map +1 -1
- package/dist/lib/utils/github.js +15 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/lib/downloadRosenAssets.ts +19 -10
- package/lib/utils/github.ts +16 -0
- package/package.json +3 -4
- package/tests/data/octokit.data.ts +9 -0
- package/tests/downloadRosenAssets.spec.ts +33 -3
- package/tests/mocks/octokit.mock.ts +18 -0
- package/tests/utils/github.spec.ts +21 -1
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
findLastRelease,
|
|
6
6
|
isStableReleaseForChainType,
|
|
7
7
|
findLatestStableRelease,
|
|
8
|
+
getReleaseByTag,
|
|
8
9
|
} from '../../lib/utils/github';
|
|
9
10
|
|
|
10
11
|
import {
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
testNetStableRelease,
|
|
16
17
|
} from '../data/octokit.data';
|
|
17
18
|
|
|
18
|
-
import { mockOctokit } from '../mocks/octokit.mock';
|
|
19
|
+
import { mockOctokit, mockOctokitGetReleaseByTag } from '../mocks/octokit.mock';
|
|
19
20
|
|
|
20
21
|
describe('fetchReleasesPage', () => {
|
|
21
22
|
/**
|
|
@@ -103,6 +104,25 @@ describe('findLastRelease', () => {
|
|
|
103
104
|
});
|
|
104
105
|
});
|
|
105
106
|
|
|
107
|
+
describe('getReleaseByTag', () => {
|
|
108
|
+
/**
|
|
109
|
+
* @target `getReleaseByTag` should get release by tag
|
|
110
|
+
* @dependencies
|
|
111
|
+
* - mocked `getReleaseByTag` of Octokit
|
|
112
|
+
* @scenario
|
|
113
|
+
* - call the function
|
|
114
|
+
* @expected
|
|
115
|
+
* - the release should be the expected one
|
|
116
|
+
*/
|
|
117
|
+
it('should get release by tag', async () => {
|
|
118
|
+
mockOctokitGetReleaseByTag();
|
|
119
|
+
|
|
120
|
+
const release = await getReleaseByTag('3');
|
|
121
|
+
|
|
122
|
+
expect(release.id).toEqual(3);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
106
126
|
describe('hasAssetForChainType', () => {
|
|
107
127
|
/**
|
|
108
128
|
* @target `hasAssetForChainType` should return `true` if a release has asset
|