advanced-github-notifier icon indicating copy to clipboard operation
advanced-github-notifier copied to clipboard

Add documentation for contributors

Open kumar303 opened this issue 5 years ago • 2 comments

Hi @freaktechnik . I didn't see any docs for how to set up this repo for local development. Could you add some? I tried to follow the .travis.yml configuration but I can't get it set up. Here are the steps I took:

  • With Node 10.15.0 (currently active LTS) on macOS 10.12.6, I ran npm install
  • I ran npm test and got "38 hooks failed"
Full test output
$ npm test

> [email protected] test /Users/kumar/tmp/advanced-github-notifier
> nyc ava



  38 hooks failed

  github › beforeEach hook for static BASE_URI


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for static BASE_URI

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for static SITE_URI


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for static SITE_URI

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for static SCOPE


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › beforeEach hook for construction


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for static SCOPE

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › afterEach.always hook for construction

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for redirect URI


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for redirect URI

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for footer urls


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for footer urls

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for info url


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › beforeEach hook for unset token


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for info url

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › afterEach.always hook for unset token

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for authorized


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for authorized

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for not authorized


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for not authorized

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for username


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for username

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for auth url


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for auth url

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  github › beforeEach hook for set token


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  github › afterEach.always hook for set token

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › beforeEach hook for constructor


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › beforeEach hook for add handler client


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › afterEach.always hook for constructor

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › beforeEach hook for getCount


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › afterEach.always hook for add handler client

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › afterEach.always hook for getCount

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › beforeEach hook for saveNotificationFields


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › afterEach.always hook for saveNotificationFields

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › beforeEach hook for removeClient


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › afterEach.always hook for removeClient

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }



  client-manager › beforeEach hook for add non-handler Client


  Rejected promise returned by test. Reason:

  SyntaxError {
    message: 'Unexpected end of input',
  }



  client-manager › afterEach.always hook for add non-handler Client

  /Users/kumar/tmp/advanced-github-notifier/test/_env.js:74

   73:         await mk(nycConfig.tempDir);
   74:         await wf(path.join(nycConfig.tempDir, `${Date.now()}_${process.pid}_${++id}.json`), JSON.stringify(window.__coverage__), 'utf-8');
   75:     }

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'__coverage__\' of undefined',
  }

Any idea on how to get the tests to pass? They seem to be expecting coverage to be running somehow.

When running npm start, web-ext run starts up as expected. When I enter a personal GitHub token, I get desktop notifications but when I click on one it activates one of my running Firefox instances yet doesn't load the URL of the GitHub issue.

kumar303 avatar Jan 18 '19 16:01 kumar303

Test should run nyc with it, so there really shouldn't be any setup. I wonder if this is due to it behaving differently on OS X or something. Haven't touched the code in a while, will try though. Will try to see if I get similar results later tonight.

The notification issue sounds like a Firefox issue to me where the OS X click handler doesn't properly route it to the correct instance?

freaktechnik avatar Jan 18 '19 18:01 freaktechnik

Looking closer it seems like there are issues with jsdom or maybe the instrumenter in a way that the test process doesn't receive the full source code. I can't reproduce them at all locally :(

freaktechnik avatar Jan 18 '19 18:01 freaktechnik