Removes need to use babel-register (#4865)

* Removes need to use babel-register

- Adds watch to watch changes when running the test to regenerate
- Tests are now pure node 8

* Adds timing to helper.js

* Update contribution guide

* Adds inline sourcemaps generation to restore coverage

* nits
This commit is contained in:
Florent Vilmart
2018-07-02 23:30:14 -04:00
committed by GitHub
parent 74740abead
commit ae1a8226d5
86 changed files with 260 additions and 225 deletions

View File

@@ -1,8 +1,8 @@
const PushWorker = require('../src').PushWorker;
const PushUtils = require('../src/Push/utils');
const Config = require('../src/Config');
const { pushStatusHandler } = require('../src/StatusHandler');
const rest = require('../src/rest');
const PushWorker = require('../lib').PushWorker;
const PushUtils = require('../lib/Push/utils');
const Config = require('../lib/Config');
const { pushStatusHandler } = require('../lib/StatusHandler');
const rest = require('../lib/rest');
describe('PushWorker', () => {
it('should run with small batch', (done) => {
@@ -90,6 +90,10 @@ describe('PushWorker', () => {
expect(locales).toEqual(['fr']);
});
it('should handle empty body data', () => {
expect(PushUtils.getLocalesFromPush({})).toEqual([]);
});
it('transforms body appropriately', () => {
const cleanBody = PushUtils.transformPushBodyForLocale({
data: {