Home Reference Source Test Repository

buildDocs/rest.spec.js

import * as tslib_1 from "tslib";
import { expect } from 'chai';
import { Rest } from './rest';
describe('rest', () => {
    it('should change the order of arguments', () => {
        class MyClass {
            fn(...args) {
                expect(args.length).to.equal(2);
                expect(args[0]).to.equal(1);
                expect(args[1]).to.eql([2, 3, 4]);
            }
        }
        tslib_1.__decorate([
            Rest(1)
        ], MyClass.prototype, "fn", null);
        const myClass = new MyClass();
        myClass.fn(1, 2, 3, 4);
    });
});