-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new default api version definition algorithm (#372)
Co-authored-by: Mehdi Cherfaoui <[email protected]>
- Loading branch information
1 parent
aed25c5
commit e58d63a
Showing
24 changed files
with
964 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,42 @@ | ||
'use strict' | ||
const metadataManager = require('../../../../src/metadata/metadataManager') | ||
const { | ||
getDefinition, | ||
getLatestSupportedVersion, | ||
isVersionSupported, | ||
} = require('../../../../src/metadata/metadataManager') | ||
|
||
describe(`test if metadata`, () => { | ||
test('when grouped per directoryName, have classes', async () => { | ||
const metadata = await metadataManager.getDefinition('directoryName') | ||
const metadata = await getDefinition('directoryName') | ||
expect(metadata.get('classes')).toBeDefined() | ||
}) | ||
|
||
test('when grouped per directoryName, do not have do not exist', async () => { | ||
let metadata = await metadataManager.getDefinition('directoryName', '48') | ||
metadata = await metadataManager.getDefinition('directoryName', '46') | ||
let metadata = await getDefinition('directoryName', '48') | ||
metadata = await getDefinition('directoryName', '46') | ||
expect(metadata).toBeDefined() | ||
expect(metadata.get('do not exist')).toBeFalsy() | ||
}) | ||
|
||
test('getLatestSupportedVersion', async () => { | ||
let latestVersion = await getLatestSupportedVersion() | ||
expect(latestVersion).toBeDefined() | ||
expect(latestVersion).toEqual(expect.any(Number)) | ||
}) | ||
|
||
test('isVersionSupported', async () => { | ||
// Arrange | ||
const dataSet = [ | ||
[40, false], | ||
[46, true], | ||
[52, true], | ||
[55, true], | ||
] | ||
|
||
// Act & Assert | ||
for (const data of dataSet) { | ||
const result = await isVersionSupported(data[0]) | ||
expect(result).toEqual(data[1]) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.