| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,18 +58,18 @@ | |||
| 58 | 58 | "cpy": "^4.0.1", | |
| 59 | 59 | "cssnano": "^3.8.1", | |
| 60 | 60 | "cssstats": "^3.0.0", | |
| 61 | - "eslint": "^3.19.0", | ||
| 62 | - "eslint-config-airbnb": "^14.1.0", | ||
| 63 | - "eslint-config-prettier": "^1.6.0", | ||
| 61 | + "eslint": "^3.16.1", | ||
| 62 | + "eslint-config-airbnb": "13.0.0", | ||
| 63 | + "eslint-config-prettier": "^1.4.1", | ||
| 64 | 64 | "eslint-import-resolver-webpack": "^0.8.0", | |
| 65 | 65 | "eslint-plugin-flow-header": "https://github.com/eirikurn/eslint-plugin-flow-header", | |
| 66 | 66 | "eslint-plugin-flowtype": "^2.30.0", | |
| 67 | 67 | "eslint-plugin-guardian-frontend": "file:dev/eslint-plugin-guardian-frontend", | |
| 68 | - "eslint-plugin-import": "^2.2.0", | ||
| 68 | + "eslint-plugin-import": "2.2.0", | ||
| 69 | 69 | "eslint-plugin-jasmine": "^1.8.1", | |
| 70 | - "eslint-plugin-jsx-a11y": "^4.0.0", | ||
| 70 | + "eslint-plugin-jsx-a11y": "2.2.3", | ||
| 71 | 71 | "eslint-plugin-prettier": "^2.0.1", | |
| 72 | - "eslint-plugin-react": "^6.9.0", | ||
| 72 | + "eslint-plugin-react": "6.8.0", | ||
| 73 | 73 | "esprima": "1.2.2", | |
| 74 | 74 | "execa": "^0.5.0", | |
| 75 | 75 | "figures": "^2.0.0", | |
@@ -82,7 +82,7 @@ | |||
| 82 | 82 | "hasha": "^2.2.0", | |
| 83 | 83 | "jasmine-core": "^2.3.2", | |
| 84 | 84 | "jest": "^19.0.2", | |
| 85 | - "jest-teamcity-reporter": "^0.6.2", | ||
| 85 | + "jest-teamcity-reporter": "^0.4.0", | ||
| 86 | 86 | "karma": "^1.3.0", | |
| 87 | 87 | "karma-coverage": "^1.1.1", | |
| 88 | 88 | "karma-jasmine": "^1.0.2", | |
@@ -111,7 +111,7 @@ | |||
| 111 | 111 | "postcss": "^5.2.6", | |
| 112 | 112 | "postcss-pxtorem": "^3.3.1", | |
| 113 | 113 | "postcss-reporter": "^1.4.1", | |
| 114 | - "prettier": "^0.22.0", | ||
| 114 | + "prettier": "^0.20.0", | ||
| 115 | 115 | "prettysize": "^0.0.3", | |
| 116 | 116 | "raw-loader": "^0.5.1", | |
| 117 | 117 | "request": "^2.81.0", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,11 +25,14 @@ describe('$', () => { | |||
| 25 | 25 | ).toEqual('<span class="test-class"></span>'); | |
| 26 | 26 | }); | |
| 27 | 27 | ||
| 28 | - test('applies a function to an array of elements described by a selector', () => { | ||
| 29 | - $.forEachElement('.parent > *', el => el.classList.add('red')); | ||
| 30 | - expect($('.child').hasClass('red')).toBe(true); | ||
| 31 | - expect($('.sibling').hasClass('red')).toBe(true); | ||
| 32 | - }); | ||
| 28 | + test( | ||
| 29 | + 'applies a function to an array of elements described by a selector', | ||
| 30 | + () => { | ||
| 31 | + $.forEachElement('.parent > *', el => el.classList.add('red')); | ||
| 32 | + expect($('.child').hasClass('red')).toBe(true); | ||
| 33 | + expect($('.sibling').hasClass('red')).toBe(true); | ||
| 34 | + } | ||
| 35 | + ); | ||
| 33 | 36 | ||
| 34 | 37 | test("can find an element's ancestor", () => { | |
| 35 | 38 | expect( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ const Sha1 = { | |||
| 45 | 45 | // add length (in bits) into final pair of 32-bit integers (big-endian) [§5.1.1] | |
| 46 | 46 | // note: most significant word would be (len-1)*8 >>> 32, but since JS converts | |
| 47 | 47 | // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators | |
| 48 | - M[N - 1][14] = (msg.length - 1) * 8 / 2 ** 32; | ||
| 48 | + M[N - 1][14] = (msg.length - 1) * 8 / (2 ** 32); | ||
| 49 | 49 | M[N - 1][14] = Math.floor(M[N - 1][14]); | |
| 50 | 50 | M[N - 1][15] = (msg.length - 1) * 8 & 0xffffffff; | |
| 51 | 51 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,38 +5,43 @@ import timeout from 'lib/timeout'; | |||
| 5 | 5 | ||
| 6 | 6 | const chance = new Chance(); | |
| 7 | 7 | ||
| 8 | - const wait = time => | ||
| 9 | - new Promise(resolve => { | ||
| 10 | - setTimeout(resolve, time); | ||
| 11 | - }); | ||
| 8 | + const wait = time => new Promise(resolve => { | ||
| 9 | + setTimeout(resolve, time); | ||
| 10 | + }); | ||
| 12 | 11 | ||
| 13 | 12 | describe('timeout', () => { | |
| 14 | - test("resolves with the promised value if the timeout doesn't fire", done => { | ||
| 15 | - const time = chance.integer({ min: 0, max: 10 }); | ||
| 16 | - const value = chance.integer(); | ||
| 13 | + test( | ||
| 14 | + "resolves with the promised value if the timeout doesn't fire", | ||
| 15 | + done => { | ||
| 16 | + const time = chance.integer({ min: 0, max: 10 }); | ||
| 17 | + const value = chance.integer(); | ||
| 17 | 18 | ||
| 18 | - timeout(time, Promise.resolve(value)) | ||
| 19 | - .then(result => { | ||
| 20 | - expect(result).toBe(value); | ||
| 21 | - return wait(time); | ||
| 22 | - }) | ||
| 23 | - .then(done) | ||
| 24 | - .catch(done.fail); | ||
| 25 | - }); | ||
| 19 | + timeout(time, Promise.resolve(value)) | ||
| 20 | + .then(result => { | ||
| 21 | + expect(result).toBe(value); | ||
| 22 | + return wait(time); | ||
| 23 | + }) | ||
| 24 | + .then(done) | ||
| 25 | + .catch(done.fail); | ||
| 26 | + } | ||
| 27 | + ); | ||
| 26 | 28 | ||
| 27 | - test("rejects with the promised error if the timeout doesn't fire", done => { | ||
| 28 | - const time = chance.integer({ min: 0, max: 10 }); | ||
| 29 | - const message = chance.sentence(); | ||
| 29 | + test( | ||
| 30 | + "rejects with the promised error if the timeout doesn't fire", | ||
| 31 | + done => { | ||
| 32 | + const time = chance.integer({ min: 0, max: 10 }); | ||
| 33 | + const message = chance.sentence(); | ||
| 30 | 34 | ||
| 31 | - timeout(time, Promise.reject(new Error(message))) | ||
| 32 | - .then(done.fail) | ||
| 33 | - .catch(error => { | ||
| 34 | - expect(error.message).toBe(message); | ||
| 35 | - return wait(time); | ||
| 36 | - }) | ||
| 37 | - .then(done) | ||
| 38 | - .catch(done.fail); | ||
| 39 | - }); | ||
| 35 | + timeout(time, Promise.reject(new Error(message))) | ||
| 36 | + .then(done.fail) | ||
| 37 | + .catch(error => { | ||
| 38 | + expect(error.message).toBe(message); | ||
| 39 | + return wait(time); | ||
| 40 | + }) | ||
| 41 | + .then(done) | ||
| 42 | + .catch(done.fail); | ||
| 43 | + } | ||
| 44 | + ); | ||
| 40 | 45 | ||
| 41 | 46 | test('rejects with timeout if promise never returns', done => { | |
| 42 | 47 | const time = chance.integer({ min: 0, max: 10 }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,14 +49,13 @@ const replaceQueryString = (params: Object) => | |||
| 49 | 49 | updateQueryString(params, history.replaceState.bind(history)); | |
| 50 | 50 | ||
| 51 | 51 | // take an Object, construct into a query, e.g. {page: 1, pageSize: 10} => page=1&pageSize=10 | |
| 52 | - const constructQuery = (query: Object): string => | ||
| 53 | - Object.keys(query) | ||
| 54 | - .map(param => { | ||
| 55 | - const value = query[param]; | ||
| 56 | - const queryValue = Array.isArray(value) ? value.join(',') : value; | ||
| 57 | - return `${param}=${queryValue}`; | ||
| 58 | - }) | ||
| 59 | - .join('&'); | ||
| 52 | + const constructQuery = (query: Object): string => Object.keys(query) | ||
| 53 | + .map(param => { | ||
| 54 | + const value = query[param]; | ||
| 55 | + const queryValue = Array.isArray(value) ? value.join(',') : value; | ||
| 56 | + return `${param}=${queryValue}`; | ||
| 57 | + }) | ||
| 58 | + .join('&'); | ||
| 60 | 59 | ||
| 61 | 60 | const getPath = (url: string): string => { | |
| 62 | 61 | const a: HTMLAnchorElement = document.createElement('a'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,35 +61,44 @@ describe('Check Mediator', () => { | |||
| 61 | 61 | checkMediator.resolveCheck('check-1', true); | |
| 62 | 62 | }); | |
| 63 | 63 | ||
| 64 | - test('resolves a check with dependent checks as true when passCondition is EVERYCHECKPASSED', done => { | ||
| 65 | - checkMediator.waitForCheck('check-2').then(result => { | ||
| 66 | - expect(result).toBe(true); | ||
| 67 | - done(); | ||
| 68 | - }); | ||
| 64 | + test( | ||
| 65 | + 'resolves a check with dependent checks as true when passCondition is EVERYCHECKPASSED', | ||
| 66 | + done => { | ||
| 67 | + checkMediator.waitForCheck('check-2').then(result => { | ||
| 68 | + expect(result).toBe(true); | ||
| 69 | + done(); | ||
| 70 | + }); | ||
| 69 | 71 | ||
| 70 | - checkMediator.resolveCheck('check-3', true); | ||
| 71 | - checkMediator.resolveCheck('check-4', true); | ||
| 72 | - }); | ||
| 72 | + checkMediator.resolveCheck('check-3', true); | ||
| 73 | + checkMediator.resolveCheck('check-4', true); | ||
| 74 | + } | ||
| 75 | + ); | ||
| 73 | 76 | ||
| 74 | - test('resolves a check with dependent checks as false when passCondition is EVERYCHECKPASSED', done => { | ||
| 75 | - checkMediator.waitForCheck('check-5').then(result => { | ||
| 76 | - expect(result).toBe(false); | ||
| 77 | - done(); | ||
| 78 | - }); | ||
| 77 | + test( | ||
| 78 | + 'resolves a check with dependent checks as false when passCondition is EVERYCHECKPASSED', | ||
| 79 | + done => { | ||
| 80 | + checkMediator.waitForCheck('check-5').then(result => { | ||
| 81 | + expect(result).toBe(false); | ||
| 82 | + done(); | ||
| 83 | + }); | ||
| 79 | 84 | ||
| 80 | - checkMediator.resolveCheck('check-6', true); | ||
| 81 | - checkMediator.resolveCheck('check-7', false); | ||
| 82 | - }); | ||
| 85 | + checkMediator.resolveCheck('check-6', true); | ||
| 86 | + checkMediator.resolveCheck('check-7', false); | ||
| 87 | + } | ||
| 88 | + ); | ||
| 83 | 89 | ||
| 84 | - test('resolves a check with dependent checks as true when passCondition is SOMECHECKSPASSED', done => { | ||
| 85 | - checkMediator.waitForCheck('check-8').then(result => { | ||
| 86 | - expect(result).toBe(true); | ||
| 87 | - done(); | ||
| 88 | - }); | ||
| 90 | + test( | ||
| 91 | + 'resolves a check with dependent checks as true when passCondition is SOMECHECKSPASSED', | ||
| 92 | + done => { | ||
| 93 | + checkMediator.waitForCheck('check-8').then(result => { | ||
| 94 | + expect(result).toBe(true); | ||
| 95 | + done(); | ||
| 96 | + }); | ||
| 89 | 97 | ||
| 90 | - checkMediator.resolveCheck('check-9', true); | ||
| 91 | - checkMediator.resolveCheck('check-10', false); | ||
| 92 | - }); | ||
| 98 | + checkMediator.resolveCheck('check-9', true); | ||
| 99 | + checkMediator.resolveCheck('check-10', false); | ||
| 100 | + } | ||
| 101 | + ); | ||
| 93 | 102 | ||
| 94 | 103 | test('rejects a check if not registered', done => { | |
| 95 | 104 | checkMediator.waitForCheck('check-666').catch(error => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,28 +5,27 @@ const { conf, target, hash, src } = require('../../config').paths; | |||
| 5 | 5 | ||
| 6 | 6 | module.exports = { | |
| 7 | 7 | description: 'Copy assets', | |
| 8 | - task: () => | ||
| 9 | - Promise.all([ | ||
| 10 | - cpy(['curl.js'], conf, { | ||
| 11 | - cwd: path.resolve( | ||
| 12 | - path.dirname(require.resolve('curl')), | ||
| 13 | - '..', | ||
| 14 | - 'dist', | ||
| 15 | - 'curl-with-js-and-domReady' | ||
| 16 | - ), | ||
| 17 | - }), | ||
| 18 | - cpy( | ||
| 19 | - ['**/head*.css', 'inline/**/*.css'], | ||
| 20 | - path.resolve(conf, 'inline-stylesheets'), | ||
| 21 | - { | ||
| 22 | - cwd: path.resolve(target, 'stylesheets'), | ||
| 23 | - } | ||
| 8 | + task: () => Promise.all([ | ||
| 9 | + cpy(['curl.js'], conf, { | ||
| 10 | + cwd: path.resolve( | ||
| 11 | + path.dirname(require.resolve('curl')), | ||
| 12 | + '..', | ||
| 13 | + 'dist', | ||
| 14 | + 'curl-with-js-and-domReady' | ||
| 24 | 15 | ), | |
| 25 | - cpy(['**/assets.map'], path.resolve(conf), { | ||
| 26 | - cwd: path.resolve(hash, 'assets'), | ||
| 27 | - }), | ||
| 28 | - cpy(['polyfill.io'], path.resolve(conf), { | ||
| 29 | - cwd: path.resolve(src, 'javascripts'), | ||
| 30 | - }), | ||
| 31 | - ]), | ||
| 16 | + }), | ||
| 17 | + cpy( | ||
| 18 | + ['**/head*.css', 'inline/**/*.css'], | ||
| 19 | + path.resolve(conf, 'inline-stylesheets'), | ||
| 20 | + { | ||
| 21 | + cwd: path.resolve(target, 'stylesheets'), | ||
| 22 | + } | ||
| 23 | + ), | ||
| 24 | + cpy(['**/assets.map'], path.resolve(conf), { | ||
| 25 | + cwd: path.resolve(hash, 'assets'), | ||
| 26 | + }), | ||
| 27 | + cpy(['polyfill.io'], path.resolve(conf), { | ||
| 28 | + cwd: path.resolve(src, 'javascripts'), | ||
| 29 | + }), | ||
| 30 | + ]), | ||
| 32 | 31 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,25 +5,22 @@ module.exports = { | |||
| 5 | 5 | task: [ | |
| 6 | 6 | { | |
| 7 | 7 | description: 'Old IE', | |
| 8 | - task: () => | ||
| 9 | - compile('old-ie.*.scss', { | ||
| 10 | - browsers: 'Explorer 8', | ||
| 11 | - remify: false, | ||
| 12 | - }), | ||
| 8 | + task: () => compile('old-ie.*.scss', { | ||
| 9 | + browsers: 'Explorer 8', | ||
| 10 | + remify: false, | ||
| 11 | + }), | ||
| 13 | 12 | }, | |
| 14 | 13 | { | |
| 15 | 14 | description: 'IE9', | |
| 16 | - task: () => | ||
| 17 | - compile('ie9.*.scss', { | ||
| 18 | - browsers: 'Explorer 9', | ||
| 19 | - }), | ||
| 15 | + task: () => compile('ie9.*.scss', { | ||
| 16 | + browsers: 'Explorer 9', | ||
| 17 | + }), | ||
| 20 | 18 | }, | |
| 21 | 19 | { | |
| 22 | 20 | description: 'Email', | |
| 23 | - task: () => | ||
| 24 | - compile('head.email-{article,front}.scss', { | ||
| 25 | - remify: false, | ||
| 26 | - }), | ||
| 21 | + task: () => compile('head.email-{article,front}.scss', { | ||
| 22 | + remify: false, | ||
| 23 | + }), | ||
| 27 | 24 | }, | |
| 28 | 25 | { | |
| 29 | 26 | description: 'Modern', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,28 +24,29 @@ const toDataURI = (srcPath, data) => | |||
| 24 | 24 | .extname(srcPath) | |
| 25 | 25 | .substr(1)]};base64,${data.toString()})`; | |
| 26 | 26 | ||
| 27 | - const generateCSS = (fontFamily, font) => | ||
| 28 | - readFile(path.resolve(src, 'fonts', `${font.src}`), 'base64') | ||
| 29 | - .then(data => | ||
| 30 | - postcss([perfectionist({ format: 'compressed' })]).process( | ||
| 31 | - ` | ||
| 27 | + const generateCSS = (fontFamily, font) => readFile( | ||
| 28 | + path.resolve(src, 'fonts', `${font.src}`), | ||
| 29 | + 'base64' | ||
| 30 | + ) | ||
| 31 | + .then(data => postcss([perfectionist({ format: 'compressed' })]).process( | ||
| 32 | + ` | ||
| 32 | 33 | @font-face { | |
| 33 | 34 | font-family: ${fontFamily}; | |
| 34 | 35 | src: ${toDataURI(font.src, data)}; | |
| 35 | 36 | ${[ | |
| 36 | - 'font-weight', | ||
| 37 | - 'font-style', | ||
| 38 | - 'font-stretch', | ||
| 39 | - 'font-variant', | ||
| 40 | - 'font-feature-settings', | ||
| 41 | - 'unicode-range', | ||
| 42 | - ] | ||
| 43 | - .map(prop => font[prop] ? `${prop}: ${font[prop]};` : '') | ||
| 44 | - .join('')} | ||
| 37 | + 'font-weight', | ||
| 38 | + 'font-style', | ||
| 39 | + 'font-stretch', | ||
| 40 | + 'font-variant', | ||
| 41 | + 'font-feature-settings', | ||
| 42 | + 'unicode-range', | ||
| 43 | + ] | ||
| 44 | + .map(prop => font[prop] ? `${prop}: ${font[prop]};` : '') | ||
| 45 | + .join('')} | ||
| 45 | 46 | } | |
| 46 | 47 | ` | |
| 47 | - )) | ||
| 48 | - .then(result => result.css); | ||
| 48 | + )) | ||
| 49 | + .then(result => result.css); | ||
| 49 | 50 | ||
| 50 | 51 | module.exports = { | |
| 51 | 52 | description: 'Compile fonts', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,7 +113,9 @@ module.exports = { | |||
| 113 | 113 | ); | |
| 114 | 114 | }) | |
| 115 | 115 | .then(normalisedAssetMap => // save the asset map | |
| 116 | - mkdirpp(path.resolve(hash, 'assets')).then(() => | ||
| 116 | + mkdirpp( | ||
| 117 | + path.resolve(hash, 'assets') | ||
| 118 | + ).then(() => | ||
| 117 | 119 | writeFile( | |
| 118 | 120 | path.resolve(hash, 'assets', 'assets.map'), | |
| 119 | 121 | JSON.stringify(normalisedAssetMap, null, 4) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments