mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
- index.html has manifest file and angular.min.js - index-jq.html has manifest file, angular.min.js and jquery.min.js - index-debug.html has angular.js - index-jq-debug.html has angular.js and jquery.min.js
34 lines
869 B
JavaScript
34 lines
869 B
JavaScript
var writer = require('writer.js');
|
|
describe('writer', function(){
|
|
describe('toString', function(){
|
|
var toString = writer.toString;
|
|
|
|
it('should merge string', function(){
|
|
expect(toString('abc')).toEqual('abc');
|
|
});
|
|
|
|
it('should merge obj', function(){
|
|
expect(toString({a:1})).toEqual('{"a":1}');
|
|
});
|
|
|
|
it('should merge array', function(){
|
|
expect(toString(['abc',{}])).toEqual('abc{}');
|
|
});
|
|
});
|
|
|
|
describe('replace method', function() {
|
|
var content,
|
|
replacements;
|
|
|
|
beforeEach(function() {
|
|
content = 'angular super jQuery manifest';
|
|
});
|
|
|
|
it('should replace placeholders', function() {
|
|
replacements = {'angular': 'ng', 'jQuery': 'jqlite','notHere': 'here'};
|
|
|
|
content = writer.replace(content, replacements);
|
|
expect(content).toBe('ng super jqlite manifest');
|
|
});
|
|
});
|
|
});
|