Files
habitica/test/spec/specHelper.js
Nick Tomlin e7f65f219a WIP - Fix karma config file order to successfully boostrap app
There were a few issues here:

1. Relying on globs meant that modules were loaded out of order. So
'habitrpgc' was undefined when we were trying to add services etc to it.
The short term solution is to list them in the same way we list them in manifest
json. The long term would be switching everything to browserify so as to
avoid ordering/listing nightmare by having a single bundle.
2. We were missing exeternal deps (like 'hello') so the tests were
breaking before they even started. Some of them still are
3. We were including services that don't seem to exist anymore  (e.g. `habitrpgstatic`). We still are in certain places
2015-03-05 12:12:32 -06:00

33 lines
704 B
JavaScript

beforeEach(module('habitrpg'));
specHelper = {
newUser: function(){
var buffs = {per:0, int:0, con:0, str:0, stealth: 0, streaks: false};
user = {
auth:{timestamps: {}},
stats: {str:1, con:1, per:1, int:1, mp: 32, class: 'warrior', buffs: buffs, gp: 0},
items:{
lastDrop:{count: 0},
hatchingPotions: {},
eggs: {},
food: {},
pets: {},
gear: {equipped: {}, costume: {}},
},
party: {
quest: {
progress: {down: 0}
}
},
preferences: {},
dailys: [],
todos: [],
rewards: [],
flags: {},
filters: {},
achievements: {},
};
return user;
}
};