New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-runner-tsd

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-runner-tsd - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

src/toTestResult.js

2

package.json
{
"name": "jest-runner-tsd",
"version": "1.0.1",
"version": "1.1.0",
"description": "A Jest runner that tests typescript typings using tsd under the hood",

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

@@ -1,19 +0,20 @@

// @ts-check
const { toTestResult } = require('./toTestResult');
const { toMultipleTestResults } = require('./toMultipleTestResults');
module.exports.fail = ({ start, end, test, errorMessage, numFailed, numPassed }) => {
const stats = {
failures: numFailed,
passes: numPassed,
pending: 0,
todo: 0,
end,
start,
};
module.exports.fail = ({ start, end, failures, numPassed }) => {
return toMultipleTestResults({
stats: {
failures: failures.length,
pending: 0,
passes: numPassed,
todo: 0,
start,
end,
},
tests: failures,
jestTestPath: failures[0].path,
skipped: false,
return toTestResult({
stats,
title: 'Type Checks',
errorMessage: errorMessage.join('\n'),
tests: [{duration: end - start, ...test}],
jestTestPath: test.path,
});
}
};

@@ -1,5 +0,5 @@

const { toMultipleTestResults } = require('./toMultipleTestResults');
const { toTestResult } = require('./toTestResult');
module.exports.pass = ({ start, end, test, numPassed }) => {
return toMultipleTestResults({
return toTestResult({
stats: {

@@ -6,0 +6,0 @@ failures: 0,

@@ -46,13 +46,17 @@ // @ts-check

if (numFailed > 0) {
const failures = failedTests.map((test) => ({
path: test.fileName,
errorMessage: test.message,
title: `${testFile}:${test.line}:${test.column} - ${test.severity} - ${test.message}`
}));
let errorMessage = [];
failedTests.forEach(test => {
errorMessage.push(`${testFile}:${test.line}:${test.column} - ${test.severity} - ${test.message}`);
});
return fail({
start,
end: +new Date(),
failures,
numPassed
test: {
path: testPath
},
numFailed,
numPassed,
errorMessage,
});

@@ -59,0 +63,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