Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember test #4

Open
sebyx07 opened this issue Sep 2, 2016 · 1 comment
Open

Ember test #4

sebyx07 opened this issue Sep 2, 2016 · 1 comment

Comments

@sebyx07
Copy link

sebyx07 commented Sep 2, 2016

I'm using ember-cli-mocha, I don't know why I cannot see the tests running in the browser using
docker-compose run frontend ember test --server Also tried to pass the host option --host 0.0.0.0 but with no luck
The forwarded port for the server is "8081:7357"

@danlynn
Copy link
Owner

danlynn commented Sep 7, 2016

Note that the default command for this docker image is "server". Thus, when you just do a docker-compose up, it will run the ember server.

If you are using a generic docker-compose.yml file something like:

server:
image: danlynn/ember-cli:2.7.0
volumes:
- .:/myapp

ember port = 4200

livereload port = 49152

ports:
- "4200:4200"
- "49152:49152"

...then you would simply leave off the command for the docker-compose run and instead just provide the options like:

$ docker-compose run server -v
ember-cli: 2.7.0
node: 4.2.3
os: linux x64

...or in your specific example:

$ docker-compose run server test
Built project successfully. Stored in "/myapp/tmp/core_object-tests_dist-jFFxEQr6.tmp".
ok 1 PhantomJS 2.1 - JSHint | app.js: should pass jshint
ok 2 PhantomJS 2.1 - JSHint | helpers/destroy-app.js: should pass jshint
ok 3 PhantomJS 2.1 - JSHint | helpers/module-for-acceptance.js: should pass jshint
ok 4 PhantomJS 2.1 - JSHint | helpers/resolver.js: should pass jshint
ok 5 PhantomJS 2.1 - JSHint | helpers/start-app.js: should pass jshint
ok 6 PhantomJS 2.1 - JSHint | resolver.js: should pass jshint
ok 7 PhantomJS 2.1 - JSHint | router.js: should pass jshint
ok 8 PhantomJS 2.1 - JSHint | test-helper.js: should pass jshint

1..8

tests 8

pass 8

skip 0

fail 0

ok

However, if you are using a docker-compose.yml file with additional services defined like in the README.md of this docker image,

ember: &defaults
image: danlynn/ember-cli:2.7.0
volumes:
- .:/myapp
server:
<<: *defaults
command: server --watcher polling
ports:
- "4200:4200"
- "49152:49152"

then you should be able to execute the 'ember' service defined in that docker-compose.yml file as:

$ docker-compose run ember test
Built project successfully. Stored in "/myapp/tmp/core_object-tests_dist-3rHSGfZU.tmp".
ok 1 PhantomJS 2.1 - JSHint | app.js: should pass jshint
ok 2 PhantomJS 2.1 - JSHint | helpers/destroy-app.js: should pass jshint
ok 3 PhantomJS 2.1 - JSHint | helpers/module-for-acceptance.js: should pass jshint
ok 4 PhantomJS 2.1 - JSHint | helpers/resolver.js: should pass jshint
ok 5 PhantomJS 2.1 - JSHint | helpers/start-app.js: should pass jshint
ok 6 PhantomJS 2.1 - JSHint | resolver.js: should pass jshint
ok 7 PhantomJS 2.1 - JSHint | router.js: should pass jshint
ok 8 PhantomJS 2.1 - JSHint | test-helper.js: should pass jshint

1..8

tests 8

pass 8

skip 0

fail 0

ok

Note that with the docker-compose.yml file above, both server and ember actually execute the same command. It is just that in the case of ember that it doesn't additionally map the ports (since we probably aren't running the server if we are just executing something quick with the ember command.

On Sep 2, 2016, at 10:34 AM, Sebi [email protected] wrote:

I'm using ember-cli-mocha, I don't know why I cannot see the tests running in the browser using
docker-compose run frontend ember test --server Also tried to pass the host option --host 0.0.0.0 but with no luck
The forwarded port for the server is "8081:7357"


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #4, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA6Yi2WOMOqXbjDg8ZVgvi2-sH4X9YSks5qmDPygaJpZM4JzxO6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants