Hallo ich Unit-Test versuchen, während eine einfache Web mit AngularJS + Firebase zu entwickeln, aber ich habe ein Problem, die Spezifikation zu definieren und den Test Läufer versuchen,Firebase App namens ‚[STANDARD]‘ ist bereits vorhanden (app/Duplikat-app)
myProject/test/spec/main.js:
describe('Controller: MainCtrl', function() {
var MainCtrl, scope
beforeEach(module('MainApp'));
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $controller('MainCtrl', {
$scope: scope
})
}));
it('should....',function(){
expect(true).toBe(true)
})
it('should2....',function(){
expect(false).toBe(false)
})
});
Ergebnis:
PhantomJS 2.1.1 (Mac OS X 0.0.0) Controller: MainCtrl should.... FAILED
Error: [$injector:modulerr] Failed to instantiate module MainApp due
to: Firebase: Firebase App named '[DEFAULT]' already exists
(app/duplicateapp).
sobald jedoch die Spezifikation definiert, ist das kein Problem. Zum Beispiel:
it('should....',function(){
expect(true).toBe(true)
})
Ich weiß nicht, warum dies der Grund, warum ich einen Hinweis zu geben mir
Hier ist das Projekt, das ich entwickeln werde.
https://github.com/parkwookyun/firebase-angular-board
Dies ist ein sehr kluger Ansatz. Vielen Dank. – Rexford