我有这个单元测试执行错误未知提供者:translateFilterProvider< - translateFilter
如何注入$ translate服务?
import angular from 'angular'
import 'angular-mocks'
let $scope
let $compile
let htmlElement
describe('ProjectGeneralSituationForm', () => {
beforeEach(angular.mock.module('ProjectGeneralSituationModule'))
beforeEach(() => {
inject((_$rootScope_, _$compile_) => {
$scope = _$rootScope_.$new()
$compile = _$compile_
})
})
beforeEach(() => {
$scope.project = {}
$scope.projectTypes = {}
$scope.projectReferences = {}
htmlElement = $compile(`<project-general-situation-form project="project" project-types="projectTypes" project-references="projectReferences"></project-general-situation-form>`)($scope)
$scope.$digest()
})
it('should be defined', () => {
expect(htmlElement).toBeDefined()
})
})