Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 2.55 KB

File metadata and controls

76 lines (53 loc) · 2.55 KB

Contributing to Bug Magnet

BugMagnet uses WebPack for packaging, Jasmine for tests (executed via Testem) and ESLint for linting. All the main scripts are in package.json

Set up a local development environment

  1. (optional, if you want to run it in a sandbox) Run the command once to build a development docker VM
make init
  1. (optional, if you want to run it in a sandbox) to start the development shell in docker, run
make shell
  1. install dependencies
npm i

Package the extension

npm run pack-extension

This will create and copy the files in the pack dir. You can then zip that up and distribute as an extension, or just load into a browser as an unpacked extension. (check out how to do this in Chrome or Firefox).

Run dev tests

npm t

Find out the actual source code from a test failure report

npm run sourcemap <packed URL without the origin and starting />

For example, given this test report:

11) [Chrome 61.0] executeRequest size generator sets the field content to a text of specified size by multiplying the template
     TypeError: handler is not a function

     TypeError: handler is not a function
         at UserContext.<anonymous> (http://localhost:7357/testem/compiled/common/execute-request-spec.js:165:4)
         at attempt (http://localhost:7357/jasmine/jasmine.js:4289:46)
         at QueueRunner.run (http://localhost:7357/jasmine/jasmine.js:4217:20)
         at QueueRunner.execute (http://localhost:7357/jasmine/jasmine.js:4199:10)
         at Spec.queueRunnerFactory (http://localhost:7357/jasmine/jasmine.js:909:35)
         at Spec.execute (http://localhost:7357/jasmine/jasmine.js:526:10)
         at UserContext.fn (http://localhost:7357/jasmine/jasmine.js:5340:37)
         at attempt (http://localhost:7357/jasmine/jasmine.js:4297:26)
         at QueueRunner.run (http://localhost:7357/jasmine/jasmine.js:4217:20)
         at QueueRunner.execute (http://localhost:7357/jasmine/jasmine.js:4199:10)

you can find out the actual error line using

npm run sourcemap testem/compiled/common/execute-request-spec.js:165:4

Run tests in an open browser session (for debugging)

npm run test-browser

This will automatically watch the source and test folders and re-run tests as the files change. The --bugmagnet:test_filter trick also works here to restrict the test run to only a subset.