├── .gitignore ├── index.js ├── package.json └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | node_modules/ -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var _ = require('underscore'); 2 | var Elixir = require('laravel-elixir'); 3 | var codecept = require('gulp-codeception'); 4 | var runTests = require('laravel-elixir/tasks/shared/Tests'); 5 | 6 | var config = Elixir.config; 7 | 8 | /* 9 | |---------------------------------------------------------------- 10 | | Codeception Testing 11 | |---------------------------------------------------------------- 12 | | 13 | | This task will trigger your entire Codeception test suite and 14 | | will show notifications indicating the success or failure 15 | | of that test suite. It works great with the tdd task. 16 | | 17 | */ 18 | 19 | Elixir.extend('codeception', function(src, options) { 20 | config.testing.codeception = { 21 | path: 'tests', 22 | 23 | options: { 24 | clear: true, 25 | notify: true 26 | } 27 | }; 28 | 29 | runTests({ 30 | name: 'codeception', 31 | src: src || (config.testing.codeception.path + '/**/*+(Test|Cept|Cest).php'), 32 | plugin: codecept, 33 | pluginOptions: options || config.testing.codeception.options 34 | }); 35 | }); 36 | 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel-elixir-codeception", 3 | "version": "0.2.0", 4 | "description": "Laravel Elixir wrapper around Codeception Gulp task.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "gulp", 11 | "laravel", 12 | "elixir", 13 | "codeception" 14 | ], 15 | "author": "Jeffrey Way", 16 | "license": "MIT", 17 | "homepage": "https://github.com/JeffreyWay/laravel-elixir-codeception", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/JeffreyWay/laravel-elixir-codeception" 21 | }, 22 | "dependencies": { 23 | "gulp-codeception": "^0.4.3", 24 | "gulp-notify": "^2.0.0", 25 | "underscore": "^1.7.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | This is a simple Codeception wrapper around Laravel Elixir. Add it to your Elixir-enhanced Gulpfile, like so: 4 | 5 | ``` 6 | var elixir = require('laravel-elixir'); 7 | 8 | require('laravel-elixir-codeception'); 9 | 10 | elixir(function(mix) { 11 | mix.codeception(); 12 | }); 13 | ``` 14 | 15 | This will scan your `./tests/` directory, as well as any PHP classes in your 'app' folder for changes, and trigger your Codeception suite. 16 | 17 | --- 18 | 19 | You may pass two arguments to the `codeception()` method. 20 | 21 | ### baseDir 22 | 23 | Defaulting to './tests', this argument specifies the root directory to search for Codeception-specific tests. 24 | 25 | ### options 26 | 27 | If you need to pass any Codeception-specific options, then you may pass an object as the second argument, like so: 28 | 29 | ``` 30 | mix.codeception(null, { flags: '--report' }); 31 | ``` 32 | 33 | Or, maybe you only want to trigger your "functional" suite. 34 | 35 | ``` 36 | mix.codeception(null, { testSuite: 'functional' }); 37 | ``` 38 | 39 | --------------------------------------------------------------------------------