This file contains 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
// This file assures that a Jest test file and Cypress test file exists for each component. | |
import path from "path"; | |
import fs from "fs"; | |
function getFiles(filepath: string) { | |
return fs.readdirSync(filepath).filter(function (file) { | |
return fs.statSync(path.join(filepath, file)).isFile(); | |
}); | |
} |
This file contains 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
// approach 1: define action object in the component | |
this.props.dispatch({ | |
type : "EDIT_ITEM_ATTRIBUTES", | |
payload : { | |
item : {itemID, itemType}, | |
newAttributes : newValue, | |
} | |
}); | |
// approach 2: use an action creator function |
This file contains 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
// approach 1: define action object in the component | |
this.props.dispatch({ | |
type : "EDIT_ITEM_ATTRIBUTES", | |
payload : { | |
item : {itemID, itemType}, | |
newAttributes : newValue, | |
} | |
}); | |
// approach 2: use an action creator function |
This file contains 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 {action1, action2} from "myActions"; | |
import {bindActionCreators} from "redux"; | |
const mapDispatchToProps(dispatch) => { | |
return { | |
manuallyBoundAction : (...args) => dispatch(action1(...args)), | |
autoBoundAction : bindActionCreators(action2, dispatch), | |
multipleActionsTogether : bindActionCreators({action1, action2}, dispatch) | |
} | |
}; |
This file contains 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'; | |
/** | |
* Module dependencies. | |
*/ | |
const webdriver = require('selenium-webdriver'); | |
/** | |
* Build driver. | |
*/ |
This file contains 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
// App | |
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app', | |
template: '<span>{{ sayHello() }}</span>', | |
}) | |
export class App { | |
public name: string = 'John'; |