示例#1
0
 it('Should return splitted string as an array', () => {
    
     const result = pipe.transform('abc', 'b', 0);
     expect(result).toEqual([]);
 });
示例#2
0
 it('Should return 1.54', () => {
    
    expect(pipe.transform(1.5444, 2)).toEqual(1.54); 
 });
示例#3
0
 it('Should do nothing', () => {
    
    expect(pipe.transform('a', 1, '')).toEqual('a');
 });
示例#4
0
 it('Should return the value unchanged', () => {
    
    expect(pipe.transform(1)).toEqual(1); 
 });
示例#5
0
 it('Should return 1', () => {
     
     expect(pipe.transform(0.65, 0)).toEqual(1);
 });
 it('should create an instance', () => {
   expect(new Usuario()).toBeTruthy();
 });
示例#7
0
 it('Should return 2.5', () => {
     
     expect(pipe.transform([1,2,3,4])).toEqual(2.5);
 });
示例#8
0
 it ('Should return the numbers in ascending order', () => {
    
    const result = pipe.transform(numbers, ['+']);
    expect(result).toEqual([-1, 0.214, 1234, 582, 8675309]); 
 });
示例#9
0
 it ('Should return the numbers in descending order', () => {
    
    const result = pipe.transform(numbers, ['-']);
    expect(result).toEqual([8675309, 582, 1234, 0.214, -1]); 
 });
示例#10
0
 it ('Should return the fruits in ascending order', () => {
    
    const result = pipe.transform(fruits, '+');
    expect(result).toEqual(['apple', 'banana', 'grape', 'orange', 'pear']); 
    expect(fruits).toEqual(["orange", "apple", "pear", "grape", "banana"]); // Check integrity
 });