Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| /** | |
| * @fileOverview Generates "Lorem ipsum" style text. | |
| * @author rviscomi@gmail.com Rick Viscomi, | |
| * tinsley@tinsology.net Mathew Tinsley | |
| * @version 1.0 | |
| */ | |
| /** | |
| * Copyright (c) 2009, Mathew Tinsley (tinsley@tinsology.net) | |
| * All rights reserved. |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
brew install fish
curl -L https://get.oh-my.fish | fish| // The hacky bit of this approach is that this module uses | |
| // jQuery, but it is not referenced here. This is because I | |
| // am populating it in the test via global namespace. | |
| // | |
| // In the browser this still works because I am adding jQuery | |
| // via a Browserify transform (browserify-global-shim). | |
| function someModule() { | |
| } | |
| modules.export = someModule; |
| const arr1 = [1,2,3] | |
| const arr2 = [4,5,6] | |
| const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6] |
You will need svn, PHPUnit and wp-cli (they are provided by VVV). Make sure you have them installed.
###1. Set up
Initialize your testing environment using install-wp-tests.sh script.This script installs a copy of Wordpress in the /tmp directory (by default) as well as the Wordpress unit testing tools. Then it creates the specified database to be used while running tests.
| # ---------------------------------- | |
| # Colors | |
| # ---------------------------------- | |
| NOCOLOR='\033[0m' | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| ORANGE='\033[0;33m' | |
| BLUE='\033[0;34m' | |
| PURPLE='\033[0;35m' | |
| CYAN='\033[0;36m' |
| // UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
| // does not support `nomodule` is probably not being used anywhere. The code below is left | |
| // for posterity. | |
| /** | |
| * Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
| * load <script nomodule> anyway. This snippet solve this problem, but only for script | |
| * tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
| * | |
| * Again: this will **not** prevent inline script, e.g.: |