baset-core
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="0.1.0"></a> | ||
# [0.1.0](https://github.com/Igmat/baset/compare/v0.0.1...v0.1.0) (2018-01-17) | ||
### Features | ||
* **Core:** Added simple comparison between temp and existing baseline ([f0a775b](https://github.com/Igmat/baset/commit/f0a775b)) | ||
<a name="0.0.1"></a> | ||
@@ -8,0 +19,0 @@ ## 0.0.1 (2018-01-16) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = require("fs"); | ||
function test(specs, baselines) { | ||
const files = specs.map(name => ({ | ||
name, | ||
output: JSON.stringify(require(name)), | ||
})); | ||
files.forEach(file => { | ||
const baselinePath = file.name.replace(/.spec.js$/, '.base'); | ||
const baseline = fs.existsSync(baselinePath) | ||
? fs.readFileSync(baselinePath, { encoding: 'utf-8' }) | ||
: false; | ||
fs.writeFile(file.name.replace(/.spec.js$/, '.base.tmp'), file.output, err => { | ||
if (err) | ||
return console.log(err); | ||
console.log(`Temp baseline for ${file.name} is written.`); | ||
if (!baseline) | ||
return; | ||
console.log((baseline === file.output) | ||
? 'Test passed' | ||
: 'Test failed'); | ||
}); | ||
}); | ||
} | ||
exports.test = test; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "baset-core", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
@@ -10,3 +11,3 @@ "build": "npm run tslint && tsc", | ||
"tslint": "tslint -c tslint.json -p tsconfig.json", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "baset" | ||
}, | ||
@@ -16,2 +17,3 @@ "author": "", | ||
"devDependencies": { | ||
"@types/node": "^9.3.0", | ||
"tslint": "^5.9.1", | ||
@@ -18,0 +20,0 @@ "typescript": "^2.6.2" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
4747
84
2
3
3