Getting back editor specs in grunt dev & index.html refurbush

pull/11750/head
Ivan Malagon 8 years ago
parent 73f29679e0
commit 926edbfbd9

@ -349,7 +349,8 @@ module.exports = function(grunt) {
grunt.registerTask('dev', 'Typical task for frontend development (watch JS/CSS changes)', [
'setConfig:env.browserify_watch:true',
'run_browserify',
'watch_but_specs']);
'connect',
'run_watch:builder_specs=false']);
grunt.registerTask('sourcemaps',
'generate sourcemaps, to be used w/ trackjs.com for bughunting', [
@ -361,29 +362,34 @@ module.exports = function(grunt) {
'uglify'
]);
grunt.registerTask('watch_but_specs', 'All watch tasks except those that watch spec changes', function () {
delete grunt.config.data.watch.js_test_spec_core_cartodb3;
delete grunt.config.data.watch.js_test_spec_client_cartodb3;
delete grunt.config.data.watch.js_test_jasmine_core_cartodb3;
delete grunt.config.data.watch.js_test_jasmine_client_cartodb3;
delete grunt.config.data.watch.js_affected;
grunt.registerTask('run_watch', 'All watch tasks except those that watch spec changes', function (option) {
if (option === 'builder_specs=false') {
delete grunt.config.data.watch.js_test_spec_core_cartodb3;
delete grunt.config.data.watch.js_test_spec_client_cartodb3;
delete grunt.config.data.watch.js_test_jasmine_core_cartodb3;
delete grunt.config.data.watch.js_test_jasmine_client_cartodb3;
delete grunt.config.data.watch.js_affected;
}
grunt.task.run('watch');
});
grunt.registerTask('run_browserify', 'Browserify task with options', function (option) {
var skipSpecs = false;
var skipAllSpecs = false;
var skipBuilderSpecs = false;
if (environment !== DEVELOPMENT) {
grunt.log.writeln('Skipping specs generation by browserify because not in development environment.');
skipSpecs = true;
grunt.log.writeln('Skipping all specs generation by browserify because not in development environment.');
skipAllSpecs = true;
} else if (!isRunningTask('test', grunt)) {
grunt.log.writeln('Skipping specs generation by browserify because we are not running the `test` task.');
skipSpecs = true;
grunt.log.writeln('Skipping only Builder specs generation by browserify because we are not running the `test` task.');
skipBuilderSpecs = true;
}
if (skipSpecs) {
if (skipAllSpecs) {
delete grunt.config.data.browserify['test_specs_for_browserify_modules'];
delete grunt.config.data.browserify['cartodb3-specs'];
} else if (skipBuilderSpecs) {
delete grunt.config.data.browserify['cartodb3-specs'];
}
grunt.task.run('browserify');

@ -4,23 +4,48 @@
<meta charset="UTF-8" />
<title>CARTO | Frontend dev stuff</title>
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" type="text/css">
<style>
body {
font-family: 'Lato', Arial, Helvetica, sans-serif;
font-size: 1em;
}
h1 {
color: #fff;
background-color: #41B14F;
font-weight: 700;
font-size: 2em;
padding: 0.5em;
}
a {
font-size: 1.5em;
}
div {
font-size: 1em;
padding: 0.5em;
}
p.code {
color: #cc2255;
background-color: #f7f7f9;
border: #e1e1e8 solid 1px;
display: inline;
padding: 0.25em 0.5em;
}
</style>
</head>
<body>
<ul>
<li>
<a href="/_SpecRunner.html">Tests - current</a>
</li>
<li>
<h1>TESTS 🍏</h1>
<div>
<a href="/_SpecRunner.html">Old editor specs</a> ( available if running <p class="code">grunt dev</p> )
</div>
<!--<li>
<a href="/_SpecRunner-cartodb3.html">Tests - editor 3.0</a>
</li>
<li>
<a href="/_SpecRunner-affected.html">Builder - Only affected specs</a>
</li>
<li>
Use <em>npm test</em> in a terminal for CLI tests (unit/integration tests that does not require any browser stuff)
</li>
</ul>
</li>-->
<div>
<a href="/_SpecRunner-affected.html">Builder specs</a> ( available if running <p class="code">grunt affected_specs</p> )
</div>
<div>You can run both test suites through command line using <p class="code">grunt test</p></div>
</body>
</html>

Loading…
Cancel
Save