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

[RFR] Use fakerest and webpack-dev-server instead of json-server and grunt-connect #625

Merged
merged 7 commits into from
Sep 3, 2015

Conversation

jeromemacias
Copy link
Contributor

  • Use Fakerest and webpack-dev-server for demo
  • Use Fakerest for e2e tests
  • Fix unit tests (using sinon 1.14.1 instead of sinon-2.0)
  • Use latest fakerest
  • Clean Gruntfile.js

@@ -5,7 +5,7 @@ install:
./node_modules/protractor/bin/webdriver-manager update

run:
@grunt
@./node_modules/webpack-dev-server/bin/webpack-dev-server.js --colors --devtool cheap-module-inline-source-map --content-base examples/blog --port 8000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to remove the related conf in Gruntfile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@fzaninotto
Copy link
Member

Awesome!

@jeromemacias jeromemacias changed the title [WIP] Use fakerest and webpack-dev-server instead of json-server and grunt-connect [RFR] Use fakerest and webpack-dev-server instead of json-server and grunt-connect Aug 27, 2015
@@ -0,0 +1 @@
../../../node_modules/fakerest/dist/FakeRest.min.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what that file does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a symlink to the fakerest node module, to be able to import it in the <script> of the demo index.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, that's how GitHub show symlinks, I didn't know

@fzaninotto
Copy link
Member

Let me add another item:

-[ ] Add a task to compile and save the JS so that the entire demo can be run from a static server (think gh-pages)

}
}
},
test_fakerest: {
src: 'node_modules/fakerest/dist/FakeRest.min.js',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to copy if there is a symlink?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because copy from example build directory to test build directory does not copy symlinks (which would be broken anyway).

@jeromemacias jeromemacias changed the title [RFR] Use fakerest and webpack-dev-server instead of json-server and grunt-connect [WIP] Use fakerest and webpack-dev-server instead of json-server and grunt-connect Sep 1, 2015
@fzaninotto
Copy link
Member

Closes #320

@fzaninotto
Copy link
Member

Could you rebase? No need for the additional task I mentioned, we'll use something else for the demo.

@jeromemacias jeromemacias changed the title [WIP] Use fakerest and webpack-dev-server instead of json-server and grunt-connect [RFR] Use fakerest and webpack-dev-server instead of json-server and grunt-connect Sep 2, 2015
@jeromemacias
Copy link
Contributor Author

Rebased

@@ -165,7 +165,7 @@ describe('List filter', function () {
$$('.filters .filter:nth-child(1) input').sendKeys('be');
browser.driver.sleep(600); // debounce delay
$$('ma-datagrid-pagination .total').then(function (totalElements) {
expect(totalElements[0].getText()).toBe('1 - 5 on 5');
expect(totalElements[0].getText()).toBe('1 - 4 on 4');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it change if the dataset is the same? Something's wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how it's possible to find 5 records, see http://ng-admin.marmelab.com/#/comments/list?search={%22q%22:%22be%22}&page=1

But if I search for b instead of be, 5 records are found, maybe a coincidence, but this is the only explaination I see, protractor wasn't wait for the e with the old basecode.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, FakeRest doesn't handle the q search inside composite fields (the 5th comment has an author.name containing 'be'.

fzaninotto added a commit that referenced this pull request Sep 3, 2015
[RFR] Use fakerest and webpack-dev-server instead of json-server and grunt-connect
@fzaninotto fzaninotto merged commit cc6a89d into master Sep 3, 2015
@fzaninotto fzaninotto deleted the fakerest branch September 3, 2015 09:19
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

Successfully merging this pull request may close these issues.

2 participants