├── .bowerrc ├── .editorconfig ├── .ember-cli ├── .gitignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── Brocfile.js ├── LICENSE ├── LICENSE.md ├── README.md ├── addon ├── .gitkeep └── debug-server.js ├── app └── .gitkeep ├── bower.json ├── config ├── ember-try.js └── environment.js ├── index.js ├── package.json ├── testem.json ├── tests ├── .jshintrc ├── acceptance.js ├── dummy │ ├── app │ │ ├── app.js │ │ ├── index.html │ │ ├── router.js │ │ ├── styles │ │ │ └── app.css │ │ └── templates │ │ │ └── application.hbs │ ├── config │ │ └── environment.js │ └── public │ │ ├── crossdomain.xml │ │ └── robots.txt ├── helpers │ ├── ember-cli.js │ ├── resolver.js │ └── start-app.js ├── index.html └── test-helper.js └── vendor └── .gitkeep /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | indent_style = space 22 | indent_size = 2 23 | 24 | [*.css] 25 | indent_style = space 26 | indent_size = 2 27 | 28 | [*.html] 29 | indent_style = space 30 | indent_size = 2 31 | 32 | [*.md] 33 | trim_trailing_whitespace = false 34 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components/* 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log 17 | testem.log -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser": true, 8 | "boss": true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | tests/ 3 | tmp/ 4 | dist/ 5 | 6 | .bowerrc 7 | .editorconfig 8 | .ember-cli 9 | .travis.yml 10 | .npmignore 11 | **/.gitkeep 12 | bower.json 13 | Brocfile.js 14 | testem.json 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | 6 | sudo: false 7 | 8 | cache: 9 | directories: 10 | - node_modules 11 | 12 | matrix: 13 | fast_finish: true 14 | 15 | before_install: 16 | - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH 17 | - "npm config set spin false" 18 | - "npm install -g npm@^2" 19 | 20 | install: 21 | - npm install -g bower 22 | - npm install 23 | - bower install 24 | 25 | script: 26 | - npm test 27 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | /* global require, module */ 3 | 4 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | var app = new EmberAddon(); 7 | 8 | // Use `app.import` to add additional libraries to the generated 9 | // output files. 10 | // 11 | // If you need to use different assets in different 12 | // environments, specify an object as the first parameter. That 13 | // object's keys should be the environment name and the values 14 | // should be the asset to use in that environment. 15 | // 16 | // If the library that you are including contains AMD or ES6 17 | // modules that you would like to import into your application 18 | // please specify an object with the list of modules as keys 19 | // along with the exports of each module as its value. 20 | 21 | module.exports = app.toTree(); 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Joost de Vries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ember-cli-remote-inspector 2 | 3 | [![Build Status](https://travis-ci.org/joostdevries/ember-cli-remote-inspector.svg)](https://travis-ci.org/joostdevries/ember-cli-remote-inspector) 4 | 5 | Lets you inspect apps running on different devices/browsers over the network using websockets. 6 | 7 | ## Usage 8 | 9 | * `npm install --save-dev ember-cli-remote-inspector` 10 | * Run `ember serve` from your project root. 11 | * Visit `localhost:30820` to open up the inspector 12 | * Visit `localhost:4200` from another browser. 13 | * Magic. 14 | 15 | ![image](https://cloud.githubusercontent.com/assets/3824616/4604177/d23ecb70-518a-11e4-8443-65fe58f59e1f.png) 16 | 17 | 18 | ## Options 19 | 20 | You can set these options in your `config/environment`, eg. `ENV.remoteDebug = true`; 21 | 22 | * `remoteDebug` (bool) Enable/disable remote debugging. Defaults to **true** in development. 23 | * `remoteDebugHost` What host should the inspector run on. This hostname/ip should be accessible over the network. Defaults to **localhost**. 24 | * `remoteDebugPort` What port should the inspector run on. Default: **30820**. 25 | * `remoteDebugScheme` What scheme should be used to load ember-debug and connect to the inspector from your app. Defaults to an empty string which means protocol-relative URLs will be used. 26 | 27 | ## Credits 28 | 29 | Much love goes out to @teddyzeenny and the other people working on the [ember inspector](https://github.com/emberjs/ember-inspector) for making this an easy job. Also credits to @rwjblue and @stefanpenner for ember-cli (addons). 30 | 31 | ## Changelog 32 | 33 | - 0.1.0 34 | - Updated Ember Inspector to 1.8.0 35 | - Added acceptance tests 36 | - Listed Express as a dependency 37 | - 0.0.2 - Support for `remoteDebugScheme` (defaults to "") 38 | - 0.0.1 - Initial release -------------------------------------------------------------------------------- /addon/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdevries/ember-cli-remote-inspector/b1d4d99105e1e052ebdf472c951a5f11b83ed55f/addon/.gitkeep -------------------------------------------------------------------------------- /addon/debug-server.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | // Websocket server which handles data to/from the inspector 3 | var fs = require('fs'); 4 | var express = require('express'); 5 | var remoteDebugger = express(); 6 | 7 | var remoteDebugServer = require('http').Server(remoteDebugger); 8 | var remoteDebugSocket = require('socket.io')(remoteDebugServer); 9 | var inspectorSocket = null; 10 | 11 | // Load the inspector html from the node_modules folder 12 | // (it should be there because we list it as a dependency) 13 | var inspectorPath = __dirname + '/../node_modules/ember-inspector/dist_websocket/'; 14 | 15 | // Server static files for the inspector 16 | remoteDebugger.use('/', express.static(inspectorPath, {index:false})); 17 | 18 | // Serve the inspector itself 19 | var inspectorHtml = fs.readFileSync(inspectorPath + 'index.html').toString(); 20 | remoteDebugger.get('/', function(req, res) { 21 | res.end(inspectorHtml); 22 | }); 23 | 24 | module.exports = { 25 | /* 26 | Injects the script used to connect socket.io to the inspector into the inspector HTML 27 | */ 28 | setRemoteDebugSocketScript: function(scriptHtml) { 29 | inspectorHtml = inspectorHtml.replace('{{ remote-port }}', scriptHtml); 30 | }, 31 | 32 | /* 33 | Start the server for the inspector + socket.io 34 | */ 35 | start: function(port, host) { 36 | remoteDebugServer.listen(port, host, function(){ 37 | console.log('Ember inspector available on http://' + host + ':' + port + '.'); 38 | }); 39 | 40 | remoteDebugSocket.on('connect', function(socket){ 41 | socket.on('emberInspectorMessage', function(msg){ 42 | // If this message comes from the inspector, emit to all clients 43 | // and set inspectorSocket 44 | if(msg.from==='devtools') { 45 | inspectorSocket = socket; 46 | remoteDebugSocket.emit('emberInspectorMessage', msg); 47 | } 48 | // If the messge comes from a client, send only to inspector 49 | else if(inspectorSocket) { 50 | inspectorSocket.emit('emberInspectorMessage', msg); 51 | } 52 | }); 53 | }); 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdevries/ember-cli-remote-inspector/b1d4d99105e1e052ebdf472c951a5f11b83ed55f/app/.gitkeep -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-remote-inspector", 3 | "dependencies": { 4 | "ember": "components/ember#canary", 5 | "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", 6 | "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", 7 | "ember-data": "1.0.0-beta.17", 8 | "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", 9 | "ember-qunit": "0.3.3", 10 | "ember-qunit-notifications": "0.0.7", 11 | "ember-resolver": "~0.1.15", 12 | "jquery": "^1.11.1", 13 | "loader.js": "ember-cli/loader.js#3.2.0", 14 | "qunit": "~1.17.1" 15 | }, 16 | "resolutions": { 17 | "ember": "canary" 18 | } 19 | } -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | scenarios: [ 3 | { 4 | name: 'default', 5 | dependencies: { } 6 | }, 7 | { 8 | name: 'ember-release', 9 | dependencies: { 10 | 'ember': 'components/ember#release' 11 | }, 12 | resolutions: { 13 | 'ember': 'release' 14 | } 15 | }, 16 | { 17 | name: 'ember-beta', 18 | dependencies: { 19 | 'ember': 'components/ember#beta' 20 | }, 21 | resolutions: { 22 | 'ember': 'beta' 23 | } 24 | }, 25 | { 26 | name: 'ember-canary', 27 | dependencies: { 28 | 'ember': 'components/ember#canary' 29 | }, 30 | resolutions: { 31 | 'ember': 'canary' 32 | } 33 | } 34 | ] 35 | }; 36 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(/* environment, appConfig */) { 4 | return { }; 5 | }; 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var remoteDebugServer = require('./addon/debug-server'); 2 | 3 | module.exports = { 4 | name: 'ember-cli-remote-inspector', 5 | 6 | config: function(environment, appConfig) { 7 | var ENV = { 8 | remoteDebug: (environment==='development'), 9 | remoteDebugHost: 'localhost', 10 | remoteDebugScheme: '', 11 | remoteDebugPort: 30820, 12 | remoteConsole: false 13 | } 14 | 15 | return ENV; 16 | }, 17 | 18 | getRemoteDebugSocketScript: function(port, host, scheme) { 19 | return '' + 20 | ''; 24 | }, 25 | 26 | getEmberDebugScript: function(port, host, scheme) { 27 | return ''; 34 | }, 35 | 36 | /* 37 | Starts the server for the inspector + socket.io and 38 | updates CSP header if present 39 | */ 40 | serverMiddleware: function(config) { 41 | var options = config.options; 42 | var app = config.app; 43 | var project = options.project; 44 | var appConfig = project.config(options.environment); 45 | 46 | if((options.environment!=='development') || !appConfig.remoteDebug) { 47 | return; 48 | } 49 | 50 | var port = process.env.EMBER_CLI_REMOTE_DEBUG_PORT = appConfig.remoteDebugPort, 51 | host = process.env.EMBER_CLI_REMOTE_DEBUG_HOST = appConfig.remoteDebugHost, 52 | scheme = process.env.EMBER_CLI_REMOTE_DEBUG_SCHEME = (appConfig.remoteDebugScheme ? appConfig.remoteDebugScheme+':' : ''); 53 | 54 | remoteDebugServer.setRemoteDebugSocketScript(this.getRemoteDebugSocketScript(port, host, scheme)); 55 | remoteDebugServer.start(port, '0.0.0.0'); 56 | 57 | // Currently only used to update the CSP header 58 | // injected by ember-cli-content-security-policy 59 | app.use(function(req, res, next) { 60 | var cspHeader = res.getHeader('Content-Security-Policy')?'Content-Security-Policy':(res.getHeader('Content-Security-Policy-Report-Only')?'Content-Security-Policy-Report-Only':null); 61 | 62 | if(cspHeader) { 63 | var cspHeaderValue = res.getHeader(cspHeader), 64 | httpCspString = (scheme ? scheme + '//' : '') + host + ':' + port, 65 | wsCspString = 'ws://' + host + ':' + port; 66 | 67 | cspHeaderValue = cspHeaderValue.replace('connect-src \'self\' ', 'connect-src \'self\' '+httpCspString+' '+wsCspString+' ') 68 | cspHeaderValue = cspHeaderValue.replace('script-src \'self\' ', 'script-src \'self\' \'unsafe-inline\' '+httpCspString+' ') 69 | res.setHeader(cspHeader, cspHeaderValue); 70 | res.setHeader('X-' + cspHeader, cspHeaderValue); 71 | } 72 | 73 | next(); 74 | }); 75 | }, 76 | 77 | contentFor: function(type) { 78 | var port = process.env.EMBER_CLI_REMOTE_DEBUG_PORT, 79 | host = process.env.EMBER_CLI_REMOTE_DEBUG_HOST, 80 | scheme = process.env.EMBER_CLI_REMOTE_DEBUG_SCHEME; 81 | 82 | if (type === 'body' && port && host) { 83 | return this.getRemoteDebugSocketScript(port, host, scheme) + this.getEmberDebugScript(port, host, scheme); 84 | } 85 | } 86 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-remote-inspector", 3 | "version": "0.1.0", 4 | "description": "Use Ember Inspector on apps running on mobile devices.", 5 | "directories": { 6 | "doc": "doc", 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "start": "ember server", 11 | "build": "ember build", 12 | "test": "node_modules/mocha/bin/mocha tests/acceptance.js" 13 | }, 14 | "repository": "https://github.com/joostdevries/ember-cli-remote-inspector", 15 | "engines": { 16 | "node": ">= 0.10.0" 17 | }, 18 | "author": "Joost de Vries", 19 | "license": "MIT", 20 | "dependencies": { 21 | "socket.io":"1.3.5", 22 | "ember-inspector": "1.8.0", 23 | "express": "^4.8.5" 24 | }, 25 | "devDependencies": { 26 | "broccoli-asset-rev": "^2.0.2", 27 | "ember-cli": "0.2.5", 28 | "ember-cli-app-version": "0.3.3", 29 | "ember-cli-content-security-policy": "0.4.0", 30 | "ember-cli-dependency-checker": "^1.0.0", 31 | "ember-cli-htmlbars": "0.7.6", 32 | "ember-cli-ic-ajax": "0.1.1", 33 | "ember-cli-inject-live-reload": "^1.3.0", 34 | "ember-cli-qunit": "0.3.13", 35 | "ember-cli-uglify": "^1.0.1", 36 | "rsvp": "latest", 37 | "mocha": "latest", 38 | "request": "latest" 39 | }, 40 | "keywords": [ 41 | "ember-addon" 42 | ], 43 | "ember-addon": { 44 | "before": "serve-files-middleware" 45 | } 46 | } -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html?hidepassed", 4 | "disable_watching": true, 5 | "launch_in_ci": [ 6 | "PhantomJS" 7 | ], 8 | "launch_in_dev": [ 9 | "PhantomJS", 10 | "Chrome" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "define", 10 | "describe", 11 | "before", 12 | "after", 13 | "it", 14 | "console", 15 | "visit", 16 | "exists", 17 | "fillIn", 18 | "click", 19 | "keyEvent", 20 | "triggerEvent", 21 | "find", 22 | "findWithAssert", 23 | "wait", 24 | "DS", 25 | "andThen", 26 | "currentURL", 27 | "currentPath", 28 | "currentRouteName" 29 | ], 30 | "node": false, 31 | "browser": false, 32 | "boss": true, 33 | "curly": false, 34 | "debug": false, 35 | "devel": false, 36 | "eqeqeq": true, 37 | "evil": true, 38 | "forin": false, 39 | "immed": false, 40 | "laxbreak": false, 41 | "newcap": true, 42 | "noarg": true, 43 | "noempty": false, 44 | "nonew": false, 45 | "nomen": false, 46 | "onevar": false, 47 | "plusplus": false, 48 | "regexp": false, 49 | "undef": true, 50 | "sub": true, 51 | "strict": false, 52 | "white": false, 53 | "eqnull": true, 54 | "esnext": true 55 | } 56 | -------------------------------------------------------------------------------- /tests/acceptance.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | var assert = require("assert"); 3 | var cli = require('./helpers/ember-cli'); 4 | var request = require('request'); 5 | 6 | describe('ember debug', function(){ 7 | this.timeout(10000); 8 | 9 | before(function(done) { 10 | var self = this; 11 | cli().then(function(child){ 12 | self.ember = child; 13 | done(); 14 | }); 15 | }); 16 | 17 | after(function() { 18 | this.ember.kill('SIGINT'); 19 | }); 20 | 21 | it('app html should contain socket code', function(done){ 22 | request.get('http://localhost:4200', function(error, response, body) { 23 | assert(body.indexOf('window.EMBER_INSPECTOR_CONFIG.remoteDebugSocket')>-1); 24 | done(); 25 | }); 26 | }); 27 | }); 28 | 29 | 30 | describe('ember inspector', function(){ 31 | this.timeout(10000); 32 | 33 | before(function(done) { 34 | var self = this; 35 | cli().then(function(child){ 36 | self.ember = child; 37 | done(); 38 | }); 39 | }); 40 | 41 | after(function() { 42 | this.ember.kill('SIGINT'); 43 | }); 44 | 45 | it('inspector page should contain socket code', function(done){ 46 | request.get('http://localhost:30820', function(error, response, body) { 47 | assert(response.statusCode===200); 48 | assert(body.indexOf('window.EMBER_INSPECTOR_CONFIG.remoteDebugSocket')>-1, 'inspector page should contain socket code'); 49 | done(); 50 | }); 51 | }); 52 | 53 | it('inspector page should contain inspector js', function(done){ 54 | request.get('http://localhost:30820/', function(error, response, body) { 55 | assert(response.statusCode===200); 56 | assert(body.indexOf('assets/ember-inspector.js')>-1); 57 | done(); 58 | }); 59 | }); 60 | 61 | it('inspector js should be available', function(done){ 62 | request.get('http://localhost:30820/assets/ember-inspector.js', function(error, response, body) { 63 | assert(response.statusCode===200); 64 | assert(body.length); 65 | done(); 66 | }); 67 | }); 68 | 69 | it('socket.io js should be available', function(done){ 70 | request.get('http://localhost:30820/socket.io/socket.io.js', function(error, response, body) { 71 | assert(response.statusCode===200); 72 | assert(body.length); 73 | done(); 74 | }); 75 | }); 76 | 77 | it('socket.io should be available', function(done){ 78 | request.get('http://localhost:30820/socket.io/?EIO=3&transport=polling', function(error, response, body) { 79 | assert(response.statusCode===200); 80 | assert(body.length); 81 | done(); 82 | }); 83 | }); 84 | }); -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | var App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | Resolver: Resolver 13 | }); 14 | 15 | loadInitializers(App, config.modulePrefix); 16 | 17 | export default App; 18 | -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | {{content-for 'head-footer'}} 16 | 17 | 18 | {{content-for 'body'}} 19 | 20 | 21 | 22 | 23 | {{content-for 'body-footer'}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | Router.map(function() { 9 | }); 10 | 11 | export default Router; 12 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdevries/ember-cli-remote-inspector/b1d4d99105e1e052ebdf472c951a5f11b83ed55f/tests/dummy/app/styles/app.css -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

Welcome to Ember.js

2 | 3 | {{outlet}} 4 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'dummy', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. 'with-controller': true 13 | } 14 | }, 15 | 16 | APP: { 17 | // Here you can pass flags/options to your application instance 18 | // when it is created 19 | } 20 | }; 21 | 22 | if (environment === 'development') { 23 | // ENV.APP.LOG_RESOLVER = true; 24 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 25 | // ENV.APP.LOG_TRANSITIONS = true; 26 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 27 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 28 | } 29 | 30 | if (environment === 'test') { 31 | // Testem prefers this... 32 | ENV.baseURL = '/'; 33 | ENV.locationType = 'none'; 34 | 35 | // keep test console output quieter 36 | ENV.APP.LOG_ACTIVE_GENERATION = false; 37 | ENV.APP.LOG_VIEW_LOOKUPS = false; 38 | 39 | ENV.APP.rootElement = '#ember-testing'; 40 | } 41 | 42 | if (environment === 'production') { 43 | 44 | } 45 | 46 | return ENV; 47 | }; 48 | -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/ember-cli.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 'use strict'; 3 | 4 | var RSVP = require('rsvp'); 5 | var spawn = require('child_process').spawn; 6 | 7 | module.exports = function run(onOutput, onError) { 8 | return new RSVP.Promise(function(resolve, reject) { 9 | var opts = {}; 10 | var child = spawn('ember', ['server']); 11 | var result = { 12 | output: [], 13 | errors: [], 14 | code: null 15 | }; 16 | 17 | child.stdout.on('data', function (data) { 18 | var string = data.toString(); 19 | if (string.indexOf('Build successful')>-1) { 20 | resolve(child); 21 | } 22 | }); 23 | 24 | child.stderr.on('data', function (data) { 25 | var string = data.toString(); 26 | process.stdout.write(string); 27 | reject(string); 28 | }); 29 | 30 | child.on('close', function (code) { 31 | result.code = code; 32 | 33 | if (code !== 0) { 34 | reject(result); 35 | } 36 | }); 37 | }); 38 | }; -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import Router from '../../router'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp(attrs) { 7 | var application; 8 | 9 | var attributes = Ember.merge({}, config.APP); 10 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 11 | 12 | Ember.run(function() { 13 | application = Application.create(attributes); 14 | application.setupForTesting(); 15 | application.injectTestHelpers(); 16 | }); 17 | 18 | return application; 19 | } 20 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | {{content-for 'test-head'}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for 'head-footer'}} 18 | {{content-for 'test-head-footer'}} 19 | 20 | 21 | 22 | {{content-for 'body'}} 23 | {{content-for 'test-body'}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for 'body-footer'}} 31 | {{content-for 'test-body-footer'}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | 6 | setResolver(resolver); 7 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joostdevries/ember-cli-remote-inspector/b1d4d99105e1e052ebdf472c951a5f11b83ed55f/vendor/.gitkeep --------------------------------------------------------------------------------