Home Reference Source Test Repository

buildDocs/flip.spec.js

import * as tslib_1 from "tslib";
import { expect } from 'chai';
import { Flip } from './flip';
describe('flip', () => {
    it('should flip the arguments of the function', () => {
        class MyClass {
            fn(a, b) {
                return [a, b];
            }
        }
        tslib_1.__decorate([
            Flip()
        ], MyClass.prototype, "fn", null);
        const myClass = new MyClass();
        expect(myClass.fn(10, 20)).to.eql([20, 10]);
    });
});