Skip to content

Commit

Permalink
🔧 Add a test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Sep 11, 2018
1 parent 6049507 commit d71bfa2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,3 +1,5 @@
node_modules
lib
coverage
coverage
harness/app/*
harness/out/*
3 changes: 2 additions & 1 deletion .npmignore
Expand Up @@ -8,4 +8,5 @@ coverage
.vscode
!static
!vendor
!lib
!lib
harness
4 changes: 4 additions & 0 deletions harness/README.md
@@ -0,0 +1,4 @@
# Test Harness
This test harness helps with verifying development in `electron-wix-msi`.
Put an electron app into the `app` directory (we're using Slack as an example)
and run `npm run harness` to ensure that the package works as intended.
32 changes: 32 additions & 0 deletions harness/harness.js
@@ -0,0 +1,32 @@
const path = require('path');
const fs = require('fs-extra');

const { MSICreator } = require('../lib/index');

const APP_DIR = path.join(__dirname, 'app');
const OUT_DIR = path.join(__dirname, 'out');

async function clean() {
await fs.ensureDir(APP_DIR);
await fs.emptyDir(OUT_DIR);
}

async function harness() {
const msiCreator = new MSICreator({
appDirectory: APP_DIR,
exe: 'slack',
manufacturer: 'Slack Technologies',
name: 'Slack',
outputDirectory: OUT_DIR,
description: 'Test',
ui: {
chooseDirectory: true
},
version: '1.2.3.4'
});

await msiCreator.create();
await msiCreator.compile();
}

harness();
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -19,7 +19,8 @@
"prepublish": "npm run build",
"build": "tsc --pretty",
"test": "npm run lint && jest",
"lint": "tslint -c tslint.json 'src/**/*.ts'"
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"harness": "npm run build && node ./harness/harness.js"
},
"dependencies": {
"debug": "^3.1.0",
Expand Down

0 comments on commit d71bfa2

Please sign in to comment.