Skip to content

Commit

Permalink
use invalid json fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Feb 13, 2018
1 parent fdd6af4 commit 0279848
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions service-tests/chocolatey.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
versionJsonFirstCharZero,
versionJsonFirstCharNotZero
} = require('./helpers/nuget-fixtures.js');
const { invalidJSON } = require('./helpers/response-fixtures');

const t = new ServiceTester({ id: 'chocolatey', title: 'Chocolatey' });
module.exports = t;
Expand Down Expand Up @@ -39,7 +40,7 @@ t.create('total downloads (unexpected response)')
.get('/dt/scriptcs.json')
.intercept(nock => nock('https://www.chocolatey.org')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27scriptcs%27%20and%20IsLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'chocolatey', value: 'invalid'});

Expand Down Expand Up @@ -102,7 +103,7 @@ t.create('version (unexpected response)')
.get('/v/scriptcs.json')
.intercept(nock => nock('https://www.chocolatey.org')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27scriptcs%27%20and%20IsLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'chocolatey', value: 'invalid'});

Expand Down Expand Up @@ -165,6 +166,6 @@ t.create('version (pre) (unexpected response)')
.get('/vpre/scriptcs.json')
.intercept(nock => nock('https://www.chocolatey.org')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27scriptcs%27%20and%20IsAbsoluteLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'chocolatey', value: 'invalid'});
7 changes: 4 additions & 3 deletions service-tests/powershellgallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
versionJsonFirstCharZero,
versionJsonFirstCharNotZero
} = require('./helpers/nuget-fixtures.js');
const { invalidJSON } = require('./helpers/response-fixtures');

const t = new ServiceTester({ id: 'powershellgallery', title: 'PowerShell Gallery' });
module.exports = t;
Expand Down Expand Up @@ -39,7 +40,7 @@ t.create('total downloads (unexpected response)')
.get('/dt/ACMESharp.json')
.intercept(nock => nock('https://www.powershellgallery.com')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27ACMESharp%27%20and%20IsLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'powershellgallery', value: 'invalid'});

Expand Down Expand Up @@ -102,7 +103,7 @@ t.create('version (unexpected response)')
.get('/v/ACMESharp.json')
.intercept(nock => nock('https://www.powershellgallery.com')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27ACMESharp%27%20and%20IsLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'powershellgallery', value: 'invalid'});

Expand Down Expand Up @@ -165,6 +166,6 @@ t.create('version (pre) (unexpected response)')
.get('/vpre/ACMESharp.json')
.intercept(nock => nock('https://www.powershellgallery.com')
.get("/api/v2/Packages()?$filter=Id%20eq%20%27ACMESharp%27%20and%20IsAbsoluteLatestVersion%20eq%20true")
.reply(200, "{{{{{invalid json}}")
.reply(invalidJSON)
)
.expectJSON({name: 'powershellgallery', value: 'invalid'});

0 comments on commit 0279848

Please sign in to comment.