Store tests_enabled flag in file.
This commit is contained in:
parent
550d33bc0f
commit
b746a0b054
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ captchas.html
|
||||
install.json
|
||||
Gruntfile.js
|
||||
.jshintrc
|
||||
.tests_enabled
|
||||
|
||||
@ -76,6 +76,10 @@ module.exports = (grunt) ->
|
||||
failOnError: true
|
||||
clean:
|
||||
command: 'node tools/clean.js'
|
||||
'tests-false':
|
||||
command: 'echo false> .tests_enabled'
|
||||
'tests-true':
|
||||
command: 'echo true> .tests_enabled'
|
||||
general:
|
||||
command: """
|
||||
<%= BIN %>coffee tools/templates.coffee src/meta/jshint.json .jshintrc
|
||||
@ -205,6 +209,14 @@ module.exports = (grunt) ->
|
||||
|
||||
grunt.registerTask 'build', [
|
||||
'shell:npm'
|
||||
'shell:tests-false'
|
||||
'shell:general'
|
||||
'concurrent:build'
|
||||
]
|
||||
|
||||
grunt.registerTask 'build-tests', [
|
||||
'shell:npm'
|
||||
'shell:tests-true'
|
||||
'shell:general'
|
||||
'concurrent:build'
|
||||
]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<% if (process.env.tests_enabled) { %>
|
||||
<% if (grunt.file.readJSON('.tests_enabled')) { %>
|
||||
BuildTest =
|
||||
init: ->
|
||||
return if !Conf['Menu'] or g.VIEW not in ['index', 'thread']
|
||||
|
||||
@ -469,7 +469,7 @@ Main =
|
||||
['Banner', Banner]
|
||||
['Flash Features', Flash]
|
||||
['Reply Pruning', ReplyPruning]
|
||||
<% if (process.env.tests_enabled) { %>
|
||||
<% if (grunt.file.readJSON('.tests_enabled')) { %>
|
||||
['Build Test', BuildTest]
|
||||
<% } %>
|
||||
]
|
||||
|
||||
@ -192,7 +192,7 @@ Keybinds =
|
||||
when Conf['Next Post Quoting You']
|
||||
return unless threadRoot and QuoteYou.db
|
||||
QuoteYou.cb.seek 'following'
|
||||
<% if (process.env.tests_enabled) { %>
|
||||
<% if (grunt.file.readJSON('.tests_enabled')) { %>
|
||||
when 't'
|
||||
return unless threadRoot
|
||||
BuildTest.testAll()
|
||||
|
||||
@ -28,7 +28,7 @@ Unread =
|
||||
name: 'Unread'
|
||||
cb: @addPost
|
||||
|
||||
<% if (process.env.tests_enabled) { %>
|
||||
<% if (grunt.file.readJSON('.tests_enabled')) { %>
|
||||
testLink = $.el 'a',
|
||||
textContent: 'Test Post Order'
|
||||
$.on testLink, 'click', ->
|
||||
|
||||
@ -3,7 +3,7 @@ class Post
|
||||
toString: -> @ID
|
||||
|
||||
constructor: (root, @thread, @board) ->
|
||||
<% if (process.env.tests_enabled) { %>
|
||||
<% if (grunt.file.readJSON('.tests_enabled')) { %>
|
||||
root2 = root.cloneNode true
|
||||
for el in $$ '.mobile', root2
|
||||
$.rm el
|
||||
|
||||
@ -4,3 +4,4 @@ fs.removeSync('tmp');
|
||||
fs.removeSync('testbuilds');
|
||||
fs.removeSync('builds');
|
||||
fs.removeSync('.jshintrc');
|
||||
fs.removeSync('.tests_enabled');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user