-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
testMatch: [ | ||
'**/?(*.)+(e2e).(test).[jt]s?(x)', | ||
], | ||
// "testPathIgnorePatterns": [ | ||
// "/node_modules/", | ||
// ] | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const fetch = require('node-fetch'); | ||
const pick = require('lodash.pick'); | ||
|
||
const PREFIX = ''; | ||
const HOST = 'shield.abap.space'; | ||
const functionName = 'version-shield-json'; | ||
const versionRe = /^v\d{1,3}\.\d{1,3}(\.\d{1,3})?$/i; | ||
|
||
const getUrl = (params) => `https://${PREFIX}${HOST}/${functionName}/${params}`; | ||
|
||
async function validateExpectations(resp) { | ||
expect(resp.ok).toBeTruthy(); | ||
const json = await resp.json(); | ||
expect(typeof json).toBe('object'); | ||
expect(pick(json, ['schemaVersion', 'label', 'color'])).toEqual({ | ||
schemaVersion: 1, | ||
label: 'abap package version', | ||
color: 'orange' | ||
}); | ||
expect(typeof json.message).toBe('string'); | ||
expect(json.message).toMatch(versionRe); | ||
} | ||
|
||
test('should process abap constant', async () => { | ||
const resp = await fetch(getUrl('github/sbcgua/mockup_loader/src/zif_mockup_loader_constants.intf.abap')); | ||
await validateExpectations(resp); | ||
}); | ||
|
||
test('should process abap constant', async () => { | ||
const resp = await fetch(getUrl('github/SAP-samples/abap-platform-jak/.apack-manifest.xml')); | ||
await validateExpectations(resp); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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