split lib/*.js into single files #503
Conversation
@OmgImAlexis Let's get quick a review for this. While I really like the sentiment, I'm not sure if every method should have it's own file. I don't really have anything else to suggest tho so I'm giving this If nobody else replies within ~24h I think we can merge. Love to see this kind of big refactoring done! |
super(); | ||
|
||
if (!(this instanceof Agenda)) { | ||
return new Agenda(config); | ||
} | ||
|
||
config = config ? config : {}; |
super(); | ||
|
||
if (!(this instanceof Agenda)) { | ||
return new Agenda(config); | ||
} | ||
|
||
config = config ? config : {}; |
simison
Aug 12, 2017
Member
config = config || {}
config = config || {}
I'm with you on that, the reason I went with all methods is that we might as well and it'll be cleaner seeing unit tests separated for each method. For example you'd have |
This was my thinking as well for +1, but maybe there's something I can't think of now to make working on this nice as well. :-) |
Once we merge this I'm going to switch all tests to avajs and split them up. That should help us get to the bottom of these flaky tests. Off to bed(4:30am here). |
@simison would you mind reviewing the last commit. |
LGTM! Now that I think of this again, having everything split into small files will help to write atomic code. Will be exciting to see ava tests in action! Ready for merge? |
* split agenda.js into single files * fix node v4/v5 incompatibility * swtich from ternary to or * split job.js into single files
I know this is another massive change but this was inevitable. The main file was getting way too large which meant every single time we have more than one person working on a section there's conflicts over the whole file. This fixes that as well as allowing us to setup debug more cleanly by each file having it's own debug field instead of every single function inside of
agenda.js
usingagenda:worker
.@simison shall I just merge once the PR goes green? I'm more than happy to rebase any/all PRs that I've broken.