-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* query options are not always camelCased * removed default values from mutually exclusive query options * add e2e tests
- Loading branch information
1 parent
56025e9
commit d916ab1
Showing
7 changed files
with
82 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import SauceLabs from '../build'; | ||
// import SauceLabs from 'saucelabs'; | ||
|
||
// Only run the test when the env var is present | ||
// in GitHub Actions, otherwise it fails for untrusted PRs | ||
const SKIP_TEST = process.env.GITHUB_RUN_ID && !process.env.SAUCE_USERNAME; | ||
|
||
jest.setTimeout(60 * 1000); // 60s should be sufficient to boot SC | ||
|
||
/** | ||
* unmock | ||
*/ | ||
jest.unmock('https').unmock('got').unmock('yargs'); | ||
|
||
test('should receive 400', async () => { | ||
if (SKIP_TEST) { | ||
return; | ||
} | ||
const api = new SauceLabs(); | ||
await expect( | ||
api.listJobs(process.env.SAUCE_USERNAME, { | ||
limit: 1, | ||
autoOnly: true, | ||
manualOnly: true, | ||
}) | ||
).rejects.toThrow( | ||
'Failed calling listJobs: Response code 400 (Bad Request), {"message":"Invalid combination of arguments."}' | ||
); | ||
}); | ||
|
||
test('should be able to list automated jobs', async () => { | ||
if (SKIP_TEST) { | ||
return; | ||
} | ||
const api = new SauceLabs(); | ||
await api.listJobs(process.env.SAUCE_USERNAME, { | ||
limit: 1, | ||
autoOnly: true, | ||
}); | ||
}); | ||
|
||
test('should be able to list live-testing jobs', async () => { | ||
if (SKIP_TEST) { | ||
return; | ||
} | ||
const api = new SauceLabs(); | ||
await api.listJobs(process.env.SAUCE_USERNAME, { | ||
limit: 1, | ||
manualOnly: true, | ||
}); | ||
}); |
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