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

after-test

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

after-test - npm Package Compare versions

Comparing version 1.0.5 to 1.0.7

72

lib/base-fixture.js

@@ -77,7 +77,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

if (!(this.isString(fileName) && this.isString(content))) {
throw new Error('[func writeFile] Filename/Content must be a string.');
throw new Error('[Aftertest writeFile] Filename/Content must be a string.');
}
if (Types.indexOf(type) < 0) {
throw new Error('[func writeFile] Type is wrong.');
throw new Error('[Aftertest writeFile] Type is wrong.');
}
// istanbul ignore next
if (type === 'error') {

@@ -90,2 +91,3 @@ fileName = 'index.json';

case 1:
// istanbul ignore next
if (!(_a.sent())) {

@@ -103,10 +105,7 @@ fs.mkdirSync(this[type]);

return __generator(this, function (_a) {
Types = ['actual', 'expect', 'error', 'src'];
Types = ['actual', 'expect', 'src'];
if (Types.indexOf(type) < 0) {
throw new Error('[func readFile] Type is wrong.');
throw new Error('[Aftertest readFile] Type is wrong.');
}
type = type + "Dir";
if (type === 'error') {
fileName = 'index.json';
}
filePath = this[type] + "/" + fileName;

@@ -123,3 +122,2 @@ return [2 /*return*/, readFileP(filePath, {

var files, dirs;
var _this = this;
return __generator(this, function (_a) {

@@ -130,13 +128,6 @@ switch (_a.label) {

files = _a.sent();
dirs = files.filter(function (file) { return __awaiter(_this, void 0, void 0, function () {
var stat;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, util_1.promisify(fs.lstat)(dirPath + "/" + file)];
case 1:
stat = _a.sent();
return [2 /*return*/, stat.isDirectory()];
}
});
}); });
dirs = files.filter(function (file) {
var stat = fs.lstatSync(dirPath + "/" + file);
return stat.isDirectory();
});
return [2 /*return*/, dirs];

@@ -179,15 +170,11 @@ }

_a.sent();
return [3 /*break*/, 5];
return [3 /*break*/, 4];
case 3:
errorJSON = require(errorPath);
errorMessage = errorJSON.message;
if (!(errorMessage.indexOf(message) < 0)) return [3 /*break*/, 5];
errorMessage.push(message);
return [4 /*yield*/, this.writeFile('error', JSON.stringify({
message: errorMessage
}, null, 2), '')];
case 4:
_a.sent();
_a.label = 5;
case 5: return [2 /*return*/];
if (errorMessage.indexOf(message) < 0) {
throw error;
}
_a.label = 4;
case 4: return [2 /*return*/];
}

@@ -207,22 +194,21 @@ });

case 1:
_a.trys.push([1, 3, , 4]);
_a.trys.push([1, 3, , 5]);
return [4 /*yield*/, this.build()];
case 2:
_a.sent();
return [3 /*break*/, 4];
return [3 /*break*/, 5];
case 3:
err_1 = _a.sent();
e = err_1;
throw err_1;
return [4 /*yield*/, this.compareError(e)];
case 4:
if (!(e === null)) return [3 /*break*/, 6];
_a.sent();
return [3 /*break*/, 5];
case 5:
if (!(e == null)) return [3 /*break*/, 7];
return [4 /*yield*/, this.compareDir()];
case 5:
case 6:
_a.sent();
return [3 /*break*/, 8];
case 6: return [4 /*yield*/, this.compareError(e)];
case 7:
_a.sent();
_a.label = 8;
case 8: return [2 /*return*/];
_a.label = 7;
case 7: return [2 /*return*/];
}

@@ -259,5 +245,9 @@ });

case 5: return [2 /*return*/];
case 6: return [4 /*yield*/, this.moveActualToExpect()];
case 6:
// istanbul ignore next
return [4 /*yield*/, this.moveActualToExpect()];
case 7:
// istanbul ignore next
_a.sent();
// istanbul ignore next
assert(true);

@@ -264,0 +254,0 @@ _a.label = 8;

{
"name": "after-test",
"version": "1.0.5",
"version": "1.0.7",
"description": "aftercss",

@@ -40,3 +40,3 @@ "bin": {

},
"gitHead": "e52549f743b72600426657ed16312bd353e65506"
"gitHead": "ce93819cbe62424cdb658d8549ff7aefd7462e8c"
}

Sorry, the diff of this file is not supported yet

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