mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Command-Ctrl-T to run Atomicity's tests. Output is in the console.
This commit is contained in:
parent
e5a5c422a4
commit
f293966a70
2
Rakefile
2
Rakefile
@ -8,7 +8,7 @@ task :build do
|
||||
|
||||
dest = File.join(built_dir, contents_dir, "Resources")
|
||||
|
||||
%w( src docs static plugins vendor ).each do |dir|
|
||||
%w( src docs static plugins test vendor ).each do |dir|
|
||||
rm_rf File.join(dest, dir)
|
||||
cp_r dir, File.join(dest, dir)
|
||||
end
|
||||
|
@ -13,7 +13,6 @@ class Tabs extends Pane
|
||||
editor: null
|
||||
|
||||
keymap:
|
||||
'Command-Ctrl-T': 'toggle'
|
||||
'Command-W': 'closeActiveTab'
|
||||
|
||||
initialize: ->
|
||||
|
3
plugins/tinytest/index.coffee
Normal file
3
plugins/tinytest/index.coffee
Normal file
@ -0,0 +1,3 @@
|
||||
exports.TinyTest = TinyTest = require 'tinytest/tinytest'
|
||||
|
||||
new TinyTest
|
37
plugins/tinytest/tinytest.coffee
Normal file
37
plugins/tinytest/tinytest.coffee
Normal file
@ -0,0 +1,37 @@
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
|
||||
Pane = require 'pane'
|
||||
File = require 'fs'
|
||||
{activeWindow} = App = require 'app'
|
||||
|
||||
{CoffeeScript} = require 'coffee-script'
|
||||
|
||||
module.exports =
|
||||
class TinyTest extends Pane
|
||||
keymap:
|
||||
'Command-Ctrl-T': 'runTests'
|
||||
|
||||
runTests: ->
|
||||
_.map File.list(App.root + '/test'), @runTest
|
||||
|
||||
runTest: (path) ->
|
||||
# Even though we already have the path, run it
|
||||
# through resolve() so we might find the dev version.
|
||||
path = require.resolve _.last path.split '/'
|
||||
name = _.last path.split '/'
|
||||
|
||||
try
|
||||
if /\.coffee$/.test path
|
||||
eval CoffeeScript.compile File.read path
|
||||
else
|
||||
eval File.read path
|
||||
console.log "all tests passed in #{name}"
|
||||
catch e
|
||||
if e.actual? and e.expected?
|
||||
console.error "#{e.operator} test failed in #{name}:"
|
||||
console.error e.actual
|
||||
console.error "isn't"
|
||||
console.error e.expected
|
||||
else
|
||||
throw e
|
@ -3,9 +3,11 @@ resourcePath = OSX.NSBundle.mainBundle.resourcePath
|
||||
paths = [
|
||||
"/Users/chris/Code/Atomicity/src",
|
||||
"/Users/chris/Code/Atomicity/plugins",
|
||||
"/Users/chris/Code/Atomicity/test",
|
||||
|
||||
"/Users/corey/code/mine/Atomicity/src",
|
||||
"/Users/corey/code/mine/Atomicity/plugins",
|
||||
"/Users/corey/code/mine/Atomicity/test",
|
||||
|
||||
"#{resourcePath}/src",
|
||||
"#{resourcePath}/plugins",
|
||||
|
@ -1,15 +0,0 @@
|
||||
# TODO: turn these into real unit tests
|
||||
OSX.NSLog 'require tests:'
|
||||
OSX.NSLog require.resolve 'underscore'
|
||||
OSX.NSLog require.resolve 'app'
|
||||
OSX.NSLog require.resolve 'tabs/tabs'
|
||||
|
||||
[ fn, window.__filename ] = [ __filename, "#{root}/src/bootstrap.js" ]
|
||||
OSX.NSLog require.resolve './document'
|
||||
OSX.NSLog require.resolve '../README.md'
|
||||
window.__filename = fn
|
||||
|
||||
OSX.NSLog require.resolve '~/.atomicity'
|
||||
OSX.NSLog require.resolve 'ace/requirejs/text!ace/css/editor.css'
|
||||
OSX.NSLog require.resolve 'ace/keyboard/keybinding'
|
||||
OSX.NSLog '--------------'
|
Loading…
Reference in New Issue
Block a user