Skip to content

Commit

Permalink
Add testing skeleton
Browse files Browse the repository at this point in the history
For #34
  • Loading branch information
sindresorhus committed Apr 1, 2017
1 parent 6705425 commit a58d209
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -14,7 +14,7 @@ function create(win, opts) {
}, {
id: 'cut',
label: 'Cut',
// needed because of macOS limitation:
// Needed because of macOS limitation:
// https://github.com/electron/electron/issues/5860
role: can('Cut') ? 'cut' : '',
enabled: can('Cut'),
Expand Down Expand Up @@ -101,7 +101,7 @@ function create(win, opts) {
});
}

// apply custom labels for default menu items
// Apply custom labels for default menu items
if (opts.labels) {
for (const menuItem of menuTpl) {
if (opts.labels[menuItem.id]) {
Expand All @@ -110,7 +110,7 @@ function create(win, opts) {
}
}

// filter out leading/trailing separators
// Filter out leading/trailing separators
// TODO: https://github.com/electron/electron/issues/5869
menuTpl = delUnusedElements(menuTpl);

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -11,7 +11,7 @@
},
"scripts": {
"start": "electron fixture.js",
"test": "xo"
"test": "xo && ava"
},
"files": [
"index.js"
Expand All @@ -31,11 +31,11 @@
"electron-is-dev": "^0.1.1"
},
"devDependencies": {
"ava": "*",
"electron": "^1.3.3",
"xo": "*"
},
"xo": {
"esnext": true,
"envs": [
"node",
"browser"
Expand Down
6 changes: 6 additions & 0 deletions test.js
@@ -0,0 +1,6 @@
import test from 'ava';
import contextMenu from '.'; // eslint-disable-line no-unused-vars

test(t => {
t.pass();
});

0 comments on commit a58d209

Please sign in to comment.