Comments (52)
Hi! It's good idea, can you add this, and create PR?
from ember-data-factory-guy.
@davetheninja .. I would be happy to merge your patch with these new additions, so go for it.
from ember-data-factory-guy.
Most excellent. I will get on the case. One other question, i noticed in the gruntfile there is grunt-contrib-coffee which is not used within the build proccess.
Is this something you were looking to do, migrate to coffeescript?
from ember-data-factory-guy.
I was going to write the tests in coffeescript, but not the core code. I was having some trouble with async tests in coffeescript so I abandoned that idea and kept with the js, but I could revisit that one day.
from ember-data-factory-guy.
Can you confirm if the master tests pass on your machine? Trying to run them and they are failing on
Error: Assertion Failed: The content property of DS.PromiseArray should be set before modifying it
Wondering if its a bug or my machine. Thanks
from ember-data-factory-guy.
Just spotted the travis file. Checked on TravisCI and can confirm it master thats failing not my local.
Ill see if i can fix that while im at it
from ember-data-factory-guy.
That was a strange one .. because my tests pass .. but when I see that error on Travis, so it's nice that you can reproduce that .. because I could not. If you can fix .. even better.
from ember-data-factory-guy.
What version of ember/ember data are you running locally.
from ember-data-factory-guy.
1.0.0-beta.8.2a68c63a
from ember-data-factory-guy.
Test in question is #createRecord adds belongsTo association to records it hasMany of within fixture adapter factory test
from ember-data-factory-guy.
Good to know .. but I am not getting that error .. what versions of ember / ember-data are you running?
from ember-data-factory-guy.
i have tried a few different, from a bower install (using whats specified in the bower.json) and have upped the versions incrementally to beta.9 - no dice
currently stepping through code in ember to see why its blowing up
from ember-data-factory-guy.
ok .. I wish I could reproduce it myself .. so thanks for trying to track it down.
from ember-data-factory-guy.
sure. what OS are you running? (not sure it would make a difference though)
from ember-data-factory-guy.
mavericks .. and what versions of ember and ember data get you this failure .. ( all of them? it sounds like )
from ember-data-factory-guy.
from ember 1.6 -> 1.8 beta 1 and ember-data 1.0.0-beta.7 -> 1.0.0-beta.9
from ember-data-factory-guy.
Its something to do with has many and async (RSVP call within the user find promise) . Ill have another look at it tomorrow
from ember-data-factory-guy.
Right. So I went back to Travis to check the logs.....
That was the commit that caused the build to fail.
I hate computers.
from ember-data-factory-guy.
geez .. that commit does not even do anything in particular .. which is why I just threw my hands up and ignored the travis test failure, since it seemed bogus. But now that you are actually reproducing it and have the bug live and fresh on your machine .. well .. yeah .. good point about computers.
from ember-data-factory-guy.
Right. Just to err on the side of caution, I checked out the GREEN tag. Still doesnt work on my machine.
Could you try a clean clone of the repo, bower install, npm install grunt test
To see if it happens on a clean build on your machine
from ember-data-factory-guy.
AH HA!!! I figured it out.
from ember-data-factory-guy.
Last passing Travis Build.....
bower install ember-data#1.0.0-beta.8
bower install jquery#1.10.2
bower install ember#1.6.1
First Failing
bower install ember-data#1.0.0-beta.9
bower install jquery#1.10.2
bower install ember#1.6.1
I forced install 1.6.1 and 1.0.0-beta.8 locally and now the tests pass.
from ember-data-factory-guy.
So to get a green build on travis, put a hard dependency on 1.6.1 and beta 8 for the time being.
from ember-data-factory-guy.
Victory is sweet. Time for beer.
from ember-data-factory-guy.
Hooray .. for you .. and for me .. I got the test to fail with fresh install ( looks like newer ember release kills that test .. but I will try and fix also ) ..
from ember-data-factory-guy.
Sure, I need a green build before I start committing changes - need a solid platform if you know what I mean.
Expect Pull requests tomorrow instead of tonight :-)
from ember-data-factory-guy.
no problem .. will be nice to get this sorted out
from ember-data-factory-guy.
I have been looking at this and the code in DS.FixtureAdapter.createRecord .. ( which is where the problem is ) and to me .. its not worth fixing this .. since I am thinking it is best to drop support for the fixture adapter anyway ..
the purpose of this project is that you don't have to use the fixture adapter, so why am I supporting it ( out of legacy is the answer .. but I barely bother with keeping fixture adapter happy ) ..
so if you start to feel like your going down a deep well and getting nowhere ..
from ember-data-factory-guy.
Agree.
—
Sent from Mailbox
On Fri, Sep 5, 2014 at 1:12 AM, Daniel Sudol [email protected]
wrote:
I have been looking at this and the code in DS.FixtureAdapter.createRecord .. ( which is where the problem is ) and to me .. its not worth fixing this .. since I am thinking it is best to drop support for the fixture adapter anyway ..
the purpose of this project is that you don't have to use the fixture adapter, so why am I supporting it ( out of legacy is the answer .. but I barely bother with keeping fixture adapter happy ) ..so if you start to feel like your going down a deep well and getting nowhere ..
Reply to this email directly or view it on GitHub:
#21 (comment)
from ember-data-factory-guy.
I mentioned the test failure to @KnownSubset .. and asked him if he could try and fix it, since he has more interest in making that code work. If he can't fix it .. I will comment out the test so the build passes and wait for inspiration to fix it myself.
from ember-data-factory-guy.
any reason why the has_many.js include in the qunit index.html is not being referenced from the dist package?
from ember-data-factory-guy.
i think has_many.js
is outdated. In latest ember-data it's not works. I have commit to up it on latest version, but we need change tests for FixtureAdapter. Build belongs_to is broken.
from ember-data-factory-guy.
p.s I have a basic setup working now where RequireJS is now supported.
I am going to refactor the test structure so that I can run all tests from Global scope and through Require.
from ember-data-factory-guy.
Ok No problem
from ember-data-factory-guy.
@davetheninja You can see my last 3 commits https://github.com/OpakAlex/ember-data-factory-guy/commits/master
from ember-data-factory-guy.
Do you use broccoli for you build?
from ember-data-factory-guy.
Personally I do use broccoli yes, I have no problem whatsoever using Grunt though given it is already integrated.
Would Broccoli be something you would want to use?
from ember-data-factory-guy.
yes, i want new version with Broccoli. It will be very nice, and we can add some console commands for ember-cli. #17 Check this one.
from ember-data-factory-guy.
Yeh thats quite sweet indeed :-)
To be honest with you guys, looking through the googlz this is the first project that has come close to what I am looking for in regards to streamlined testing within ember.
I am completely against use of fixtures as from experience (rails etc) they get out of control very quickly.
Factories on the other hand are much easier to maintain and override on a test per test basis.
Even more honestly (or stupidly) I have not even got this project to run on my app yet (amd dependency) hence I am working to add the requirejs goodies - just to test the app :-)
Once its added and I see if I can use this project, going forward I will be more than happy to invest time contributing.
As I said, from the features you currently support it looks almost perfect for my use case.
Bravo
from ember-data-factory-guy.
One other thing I would recommend is using broc + es6 concat or similar and setting up the dependencies within your source files:
Example:
import Sequence from './sequence'
var FactoryGuy = {
someMethodThatUsesSequence: function() {
return Sequence.generate();
}
}
export default FactoryGuy
The above is completely trivial example but that pattern has helped me so much (even more so when combined with CoffeeScript) when architecting my JS apps and libs.
from ember-data-factory-guy.
If you need help to testing your Ember app you can ping me.
from ember-data-factory-guy.
Thanks
from ember-data-factory-guy.
@davetheninja I think everyone is against hard coded fixtures, but using a library/factories that populate the list of fixtures is an entirely different thing. I do think that the library should become adapter agnostic so that we rely only upon the store otherwise ember-data-factory-guy's adoption will always be hindered if a new adapter comes out.
from ember-data-factory-guy.
Exactly. That's what I meant.
Factory -> attributes
factory -> store
—
Sent from Mailbox
On Fri, Sep 5, 2014 at 10:35 PM, Nathan [email protected] wrote:
@davetheninja I think everyone is against hard coded fixtures, but using a library/factories that populate the list of fixtures is an entirely different thing. I do think that the library should become adapter agnostic so that we rely only upon the store otherwise ember-data-factory-guy's adoption will always be hindered if a new adapter comes out.
Reply to this email directly or view it on GitHub:
#21 (comment)
from ember-data-factory-guy.
@davetheninja .. I am not convinced on the need for switching to brocolli, so don't include that in this pull request ( lets save for another time ) And @OpakAlex, if you want this switch from grunt, try and implement it yourself first.
from ember-data-factory-guy.
Sure. As I already said I have no intention to do anything other than requirejs initially.
—
Sent from Mailbox
On Sat, Sep 6, 2014 at 7:27 PM, Daniel Sudol [email protected]
wrote:
@davetheninja .. I am not convinced on the need for switching to brocolli, so don't include that in this pull request ( lets save for another time ) And @OpakAlex, if you want this switch from grunt, try and implement it yourself first.
Reply to this email directly or view it on GitHub:
#21 (comment)
from ember-data-factory-guy.
Got it .. and I am looking forward to seeing that in action. :)
from ember-data-factory-guy.
Hi @davetheninja .. how is it going with the amd conversion? I am guessing it got stalled .. but hoping you can finish it one of these days :)
from ember-data-factory-guy.
@indirect made this happen so I am closing this one.
from ember-data-factory-guy.
Apologies for being AWOL, family and work commitments. I am actually getting time to do some of my own project coding again.
The new factory-guy is excellent btw. Well done
from ember-data-factory-guy.
Thanks @davetheninja .. mucho appreciado and glad to see you back :)
from ember-data-factory-guy.
😌
from ember-data-factory-guy.
Related Issues (20)
- `mockFindAll` should be able to also `mockFindRecord`
- Nothing returned by handler for mockQueryRecord when mocking ember-simple-auth currentUser HOT 20
- Compatibility with Ember Data Model Fragments new refactor HOT 9
- Putting this addon up for adoption? HOT 13
- Error: Pretender intercepted GET but no handler was defined for this type of request HOT 5
- Bump pretender to 3.4.3 HOT 1
- documention error for returns method for mockCreate and mockUpdate
- Mock status is not working. HOT 1
- Factory Guy incompatible with Embroider HOT 4
- Header verification
- Dependency on older broccoli plugin versions prevents test runs with more recent ember-data versions HOT 1
- Version v4 items HOT 2
- (enhancement) Make the documentation more accessible HOT 2
- modelName being used as payloadKey
- Could not find module `@ember/debug` HOT 1
- Fix ember-assign deprecation warning
- Pretender does not catch call when mock is not define - ERROR : "The adapter operation was aborted"
- can we publish a release HOT 8
- String vs number ids and ember-data 5.3+ issues HOT 2
- Switch from pretender to msw?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-data-factory-guy.