/
githubmirror
/
angular.js
Обзор
Документация
Войти
/
githubmirror
/
angular.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/app/test/directivesSpec.js
49 строк
1 KB
Martin Staffa
chore(docs-app): add table of contents to individual pages
04 окт 2017, 16:48
04 окт 2017, 16:48
ddd78bd
Код
Авторство
О чём код?
'use strict'; describe('directives', function() { var compile, scope; beforeEach(module('directives')); beforeEach(module(function($compileProvider) { $compileProvider.debugInfoEnabled(false); })); beforeEach(inject(function($rootScope, $compile) { scope = $rootScope.$new(); compile = $compile; })); describe('code', function() { var prettyPrintOne, oldPP; var any = jasmine.any; beforeEach(function() { // Provide stub for pretty print function oldPP = window.prettyPrintOne; prettyPrintOne = window.prettyPrintOne = jasmine.createSpy(); }); afterEach(function() { window.prettyPrintOne = oldPP; }); it('should pretty print innerHTML', function() { compile('<code>var x;</code>')(scope); expect(prettyPrintOne).toHaveBeenCalledWith('var x;', null, false); }); it('should allow language declaration', function() { compile('<code class="lang-javascript"></code>')(scope); expect(prettyPrintOne).toHaveBeenCalledWith(any(String), 'javascript', false); }); it('supports allow line numbers', function() { compile('<code class="linenum"></code>')(scope); expect(prettyPrintOne).toHaveBeenCalledWith(any(String), null, true); }); }); });