Skip to content

Commit

Permalink
# This is a combination of 18 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

try gh actions

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #2:

add build

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #3:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #4:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #5:

add gh token

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #6:

fix names

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #7:

add chrome-log driver

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #8:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #9:

xvfb?

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #10:

install xvfb

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #11:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #12:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #13:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #14:

add screensize

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #15:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #16:

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #17:

xvfb-maybe

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

# This is the commit message #18:

chore!

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias committed Aug 29, 2019
1 parent 60313ac commit ea59803
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 70 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on: [push]

jobs:
lint-unit:
name: lint and unit testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
version: 12.x
- run: npm install
- run: npm run lint
- run: npm run test
e2e-build:
name: e2e tests and building
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
needs:
- lint-unit
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
version: 12.x
- run: npm install
- run: npm run test:e2e
env:
CI: true
- run: npm run build
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions appveyor.yml

This file was deleted.

27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"scripts": {
"start": "cross-env NODE_ENV=development electron -r @babel/register src/index.js",
"lint": "standard",
"test": "cross-env NODE_ENV=test mocha -r @babel/register",
"test": "cross-env NODE_ENV=test mocha test/unit/**/*.spec.js -r @babel/register",
"test:e2e": "xvfb-maybe cross-env NODE_ENV=test mocha test/e2e/**/*.e2e.js -r @babel/register",
"postinstall": "run-s install-app-deps build:webui",
"install-app-deps": "electron-builder install-app-deps",
"clean:webui": "shx rm -rf assets/webui/",
"build": "run-s build:*",
"build:webui": "run-s build:webui:*",
"build:webui:download": "npx ipfs-or-gateway -c QmNyMYhwJUS1cVvaWoVBhrW8KPj1qmie7rZcWo8f1Bvkhz -p assets/webui/ -t 360000 --verbose",
"build:webui:download": "npx ipfs-or-gateway -c QmQn7B9nLDXgDWjVjgjHActHDQ3AK1NRv7f733P8ki7dik -p assets/webui/ -t 360000 --verbose",
"build:webui:minimize": "shx rm -rf assets/webui/static/js/*.map && shx rm -rf assets/webui/static/css/*.map",
"build:babel": "babel src --out-dir out --copy-files",
"build:binaries": "electron-builder --publish onTag"
"build:binaries": "electron-builder"
},
"pre-commit": [
"lint"
Expand Down Expand Up @@ -70,7 +71,8 @@
"spectron": "^8.0.0",
"standard": "^14.0.2",
"tar": "^4.4.10",
"tmp": "0.1.0"
"tmp": "0.1.0",
"xvfb-maybe": "^0.2.1"
},
"dependencies": {
"@babel/runtime": "^7.5.5",
Expand Down
5 changes: 3 additions & 2 deletions test/launch.spec.js → test/e2e/launch.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ describe('Application launch', function () {
}) {
app = new Application({
path: electronPath,
args: ['-r', path.join(__dirname, 'utils/include.js'), path.join(__dirname, '../src/index.js')],
args: ['-r', path.join(__dirname, 'utils/include.js'), path.join(__dirname, '../../src/index.js')],
env: {
NODE_ENV: 'test',
HOME: home,
IPFS_PATH: ipfsPath
}
},
chromeDriverArgs: ['--no-sandbox']
})
await app.start()
return { app, ipfsPath, home }
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Create toggler', () => {
electron = mockElectron()
store = mockStore()
webui = mockWebUI()
createToggler = proxyquire('../src/create-toggler', {
createToggler = proxyquire('../../src/create-toggler', {
electron: electron,
'./common/store': store
}).default
Expand Down
20 changes: 10 additions & 10 deletions test/dock.spec.js → test/unit/dock.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ chai.use(dirtyChai)
describe('Dock', () => {
it('show dock succeeds with dock (macOS)', () => {
const electron = mockElectron({ withDock: true })
const { show } = proxyquire('../src/dock', { electron }).default
const { show } = proxyquire('../../src/dock', { electron }).default
show()
expect(electron.app.dock.show.callCount).to.equal(1)
})

it('show dock succeeds without dock (other OSes)', () => {
const electron = mockElectron()
const { show } = proxyquire('../src/dock', { electron }).default
const { show } = proxyquire('../../src/dock', { electron }).default
show()
})

it('hide dock succeeds with dock and no windows (macOS)', () => {
const electron = mockElectron({ withDock: true })
electron.BrowserWindow.getAllWindows.returns([])
const { hide } = proxyquire('../src/dock', { electron }).default
const { hide } = proxyquire('../../src/dock', { electron }).default
hide()
expect(electron.app.dock.hide.callCount).to.equal(1)
})
Expand All @@ -40,7 +40,7 @@ describe('Dock', () => {
{ isVisible: sinon.stub().returns(false) }
]
electron.BrowserWindow.getAllWindows.returns(windows)
const { hide } = proxyquire('../src/dock', { electron }).default
const { hide } = proxyquire('../../src/dock', { electron }).default
hide()
expect(windows[0].isVisible.callCount).to.equal(1)
expect(windows[1].isVisible.callCount).to.equal(1)
Expand All @@ -54,7 +54,7 @@ describe('Dock', () => {
{ isVisible: sinon.stub().returns(false) }
]
electron.BrowserWindow.getAllWindows.returns(windows)
const { hide } = proxyquire('../src/dock', { electron }).default
const { hide } = proxyquire('../../src/dock', { electron }).default
hide()
expect(windows[0].isVisible.callCount).to.equal(1)
expect(windows[1].isVisible.callCount).to.equal(1)
Expand All @@ -63,14 +63,14 @@ describe('Dock', () => {

it('hide dock succeeds without dock (other OSes)', () => {
const electron = mockElectron()
const { hide } = proxyquire('../src/dock', { electron }).default
const { hide } = proxyquire('../../src/dock', { electron }).default
hide()
})

it('runs async function with dock (macOS)', async () => {
const electron = mockElectron({ withDock: true })
electron.BrowserWindow.getAllWindows.returns([])
const { run } = proxyquire('../src/dock', { electron }).default
const { run } = proxyquire('../../src/dock', { electron }).default
const fn = sinon.stub().resolves(5)
const res = await run(fn)
expect(res).to.equal(5)
Expand All @@ -82,7 +82,7 @@ describe('Dock', () => {
it('runs async function without dock (other OSes)', async () => {
const electron = mockElectron()
electron.BrowserWindow.getAllWindows.returns([])
const { run } = proxyquire('../src/dock', { electron }).default
const { run } = proxyquire('../../src/dock', { electron }).default
const fn = sinon.stub().resolves(5)
const res = await run(fn)
expect(res).to.equal(5)
Expand All @@ -91,7 +91,7 @@ describe('Dock', () => {
it('runs sync function with dock (macOS)', () => {
const electron = mockElectron({ withDock: true })
electron.BrowserWindow.getAllWindows.returns([])
const { runSync } = proxyquire('../src/dock', { electron }).default
const { runSync } = proxyquire('../../src/dock', { electron }).default
const fn = sinon.stub().returns(5)
const res = runSync(fn)
expect(res).to.equal(5)
Expand All @@ -103,7 +103,7 @@ describe('Dock', () => {
it('runs sync function without dock (other OSes)', () => {
const electron = mockElectron()
electron.BrowserWindow.getAllWindows.returns([])
const { runSync } = proxyquire('../src/dock', { electron }).default
const { runSync } = proxyquire('../../src/dock', { electron }).default
const fn = sinon.stub().returns(5)
const res = runSync(fn)
expect(res).to.equal(5)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ea59803

Please sign in to comment.