Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coverbadge

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coverbadge - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

2

package.json
{
"name": "coverbadge",
"version": "0.5.4",
"version": "0.5.5",
"description": "Create a coverage badge without any service provider.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -47,4 +47,6 @@ const path = require('path');

const downloadBadge = (url, outputPath) => {
return fetch(url)
const downloadBadge = (url, outputPath, token = null) => {
const tokenQuery = token ? `?circle-token=${token}` : '';
return fetch(`${url}${tokenQuery}`)
.then(res => res.text())

@@ -75,3 +77,3 @@ .then((svg) => {

.then(artifacts => getLastBadgeURL(artifacts, outputPath))
.then(url => downloadBadge(url, outputPath))
.then(url => downloadBadge(url, outputPath, token))
};

@@ -78,0 +80,0 @@

@@ -163,2 +163,11 @@ import fs from 'fs';

});
it('should download the badge from url with token', async () => {
fetch.__setData('svg');
const outputPath = './coverage/badges.svg';
await downloadBadge('url', outputPath, 'token');
expect(fetch).toHaveBeenCalledWith('url?circle-token=token');
});
});

@@ -165,0 +174,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc