Comparing version 0.2.0 to 0.3.0
@@ -6,2 +6,6 @@ 'use strict' | ||
this.name = `Mayiawo Aken'Ova` | ||
this.alias = 'makenova' | ||
this.twitter = '@make_nova' | ||
this.github = 'https://github.com/makenova' | ||
this.website = 'http://makenova.com' | ||
this.title = 'Code pusher' | ||
@@ -8,0 +12,0 @@ } |
{ | ||
"name": "makenova", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "who is makenova?", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
57
test.js
@@ -0,1 +1,2 @@ | ||
import fs from 'fs' | ||
import test from 'ava' | ||
@@ -5,4 +6,28 @@ import execa from 'execa' | ||
function readfile(path) { | ||
return new Promise((resolve, reject) => { | ||
fs.readFile(path, 'utf8', (err, file) => { | ||
if(err) return reject(err) | ||
resolve(file) | ||
}) | ||
}) | ||
} | ||
function parse(string) { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
let json = JSON.parse(string) | ||
return resolve(json) | ||
} catch (e) { | ||
return reject(e) | ||
} | ||
}) | ||
} | ||
const name = `Mayiawo Aken'Ova` | ||
const title = `Code pusher` | ||
const alias = `makenova` | ||
const twitter = `@make_nova` | ||
const github = `https://github.com/makenova` | ||
const website = `http://makenova.com` | ||
@@ -19,2 +44,22 @@ test('test name', t => { | ||
test('test alias', t => { | ||
const makenova = new Makenova() | ||
t.is(alias, makenova.alias) | ||
}) | ||
test('test twitter', t => { | ||
const makenova = new Makenova() | ||
t.is(twitter, makenova.twitter) | ||
}) | ||
test('test github', t => { | ||
const makenova = new Makenova() | ||
t.is(github, makenova.github) | ||
}) | ||
test('test website', t => { | ||
const makenova = new Makenova() | ||
t.is(website, makenova.website) | ||
}) | ||
test('test cli name', t => { | ||
@@ -29,1 +74,13 @@ return execa.stdout('./cli.js', ['name']) | ||
}) | ||
test('test cli default no args', t => t.throws(execa('.cli.js'))) | ||
test('test cli version', t => { | ||
return Promise.all([ | ||
readfile('./package.json').then(parse).then(config => config.version), | ||
execa.stdout('./cli.js', ['--version']) | ||
]) | ||
.then(results => { | ||
t.is(results[0], results[1]) | ||
}) | ||
}) |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5058
95
1