This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "mocha-allure-16", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "prepublish": "selenium-standalone install", | |
| "pretest": "rm -rf allure-results", | |
| "test": "multi='progress=- mocha-allure-reporter=-' mocha test.js --reporter mocha-multi --timeout 30000", | |
| "report": "allure generate allure-results" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import $ from 'jquery'; | |
| import Backbone from 'backbone'; | |
| export var ajaxSpy; | |
| export default function spyAjax() { | |
| var deferreds; | |
| beforeEach(function() { | |
| deferreds = []; | |
| ajaxSpy = spyOn(Backbone, 'ajax').and.callFake(({success, error}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var React = require('react'); | |
| var ReactDOM = require('react-dom'); | |
| var Redux = require('redux'); | |
| var ReactRedux = require('react-redux'); | |
| function counter(state = 0, action) { | |
| switch (action.type) { | |
| case 'INCREMENT': | |
| return state + 1 | |
| case 'DECREMENT': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function factory(app) { | |
| return ({url, method = 'get'}) => (target, key, descriptor) => { | |
| app[method](url, target[key]); | |
| } | |
| } | |
| const Path = factory(app); | |
| class Controller { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| beforeEach(function() { | |
| global.localStorage = createLocalStorageMock(); | |
| this.server = new AxiosMock(axious); | |
| this.store = createStore(); | |
| }); | |
| afterEach(function() { | |
| this.server.restore(); | |
| delete global.localStorage; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Dropdown({title, value, options, optionKey, optionVal, onChange}) { | |
| if(values === undefined && values === null) { | |
| return <div>No data</div>; | |
| } | |
| return <div> | |
| <label>{title}:</label> | |
| <select value={value || -1} onChange={onChange}> | |
| <option key={-1} value={-1}>All</option> | |
| {values.map(function (val, idx) { | |
| return <option key={idx} value={val[optionKey]}>{val[optionVal]}</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var Benchmark = require('benchmark'); | |
| var suite = new Benchmark.Suite; | |
| var forLoop = { | |
| setup: () => { | |
| var arr = []; | |
| for (var i = 0; i < 1000; i++) { | |
| arr[i] = i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import memoize from 'fast-memoize'; | |
| function sum(a, b) { | |
| return a + b; | |
| } | |
| const memoSum = memoize(sum); | |
| console.log(sum(1, 2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = grunt => { | |
| const allure = require('allure-commandline'); | |
| grunt.registerMultiTask('allure', 'Passes commands to allure-commandline', function() { | |
| const done = this.async(); | |
| const options = this.options(); | |
| const args = []; | |
| if(this.target === 'generate') { | |
| args.push('generate'); | |
| if(options.clean) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .cache | |
| dist | |
| node_modules |