这篇文档中,会介绍如何在Ubuntu中设置端到端的测试环境。这个环境中,需要一些软件作为基础设置
- Xvfb
- Selenium
- Protractor
- Chrome+ChromeDriver
按装并设置完成之后,这个环境可以运行基于Web的应用程序的单元测试(基于Karma或者Jasmine),以及端到端测试(基于Protractor)。事实上,基于selenium客户端或者cucumber的测试也可以很容易的在该环境中运行起来。
hg clone https://bitbucket.org/ZyX_I/vim | |
cd vim | |
hg update 24-bit-xterm | |
cd src && make autoconf && cd .. | |
./configure \ | |
--enable-gui=no \ | |
--without-x \ | |
--enable-multibyte \ | |
--with-tlib=ncurses \ |
#!/usr/bin/env ruby | |
# This pre-commit hook will prevent any commit to forbidden branches | |
# (by default, "staging" and "production"). | |
# Put this file in your local repo, in the .git/hooks folder | |
# and make sure it is executable. | |
# The name of the file *must* be "pre-commit" for Git to pick it up. | |
FORBIDDEN_BRANCHES = ["staging", "production"] |
"use strict" | |
var Promise = function () { | |
this.state = 'pending' | |
this.thenables = [] | |
} | |
Promise.prototype.resolve = function (value) { | |
if (this.state != 'pending') return | |
this.state = 'fulfilled' |
'use strict'; | |
var React = require('react'); | |
var BzIframe = React.createClass({ | |
propTypes: { | |
src: React.PropTypes.string.isRequired, | |
onLoad: React.PropTypes.func | |
}, |
import React, { Component } from 'react' | |
import Subapp from './subapp/Root' | |
class BigApp extends Component { | |
render() { | |
return ( | |
<div> | |
<Subapp /> | |
<Subapp /> | |
<Subapp /> |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
// Simulate a call to Dropbox or other service that can | |
// return an image as an ArrayBuffer. | |
var xhr = new XMLHttpRequest(); | |
// Use JSFiddle logo as a sample image to avoid complicating | |
// this example with cross-domain issues. | |
xhr.open( "GET", "http://fiddle.jshell.net/img/logo.png", true ); | |
// Ask for the result as an ArrayBuffer. | |
xhr.responseType = "arraybuffer"; |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {