<commit_before>import ModifiableRoute from '../../src/classes/modifiable-route';
import ModifiedRoute from '../../src/classes/modified-route';
import Addressable from '../../src/classes/modifiers/addressable';
import OutletsReceivable from '../../src/classes/modifiers/outlets-receivable';

class IdentityModifier {
    static transform(modifiedRoute) {
        return modifiedRoute;
    }
}

class TestRoute extends ModifiableRoute {
    constructor(...args) {
        super(...args);
        this.args = args;
    }
}

let transformTestsArgs = [
    {
        addresses: ['should-be-overwritten'],
        outlets: {
            one: 1,
            two: 2,
            three: 3,
        },
    },
    4, 5, 6,
];

let transformTests = {
    address: {
        prop: 'addresses',
        args: ['addy1', 'addy2'],
        run: function(addressable) {
            let modified = addressable[this.prop](...this.args);
            // this allows us to bypass Expectable expected*() functions
            // and just check that the arguments are transformed correctly
            let stub = sinon.stub(modified, 'klass');
            modified._createInstance(...transformTestsArgs);
            stub.should.have.been.calledOnce;
            stub.should.have.been.calledWithNew;
            let callArgs = stub.getCall(0).args;
            callArgs.should.have.length.above(1);
            callArgs[0].should.have.property('addresses');
            callArgs[0].addresses.should.deep.equal(this.args);
            stub.restore();
            return modified;
        }
    },
    outlets: {
        prop: 'outlets',
        args: ['one', 'three'],
        run: function(outletable) {
            let modified = outletable[this.prop](...this.args);
            let stub = sinon.stub(modified, 'klass');
            expect(modified.outlets).to.deep.equal(this.args);
            modified._createInstance(...transformTestsArgs);
            stub.should.have.been.calledOnce;
            stub.should.have.been.calledWithNew;
            let callArgs = stub.getCall(0).args;
            callArgs.should.have.length.above(1);
            callArgs[0].should.have.property('outlets');
            callArgs[0].outlets.should.deep.equal({one: 1, three: 3});
            stub.restore();
            return modified;<commit_msg>Make sure modifiers pass all args after options<commit_after>import ModifiableRoute from '../../src/classes/modifiable-route';
import ModifiedRoute from '../../src/classes/modified-route';
import Addressable from '../../src/classes/modifiers/addressable';
import OutletsReceivable from '../../src/classes/modifiers/outlets-receivable';

class IdentityModifier {
    static transform(modifiedRoute) {
        return modifiedRoute;
    }
}

class TestRoute extends ModifiableRoute {
    constructor(...args) {
        super(...args);
        this.args = args;
    }
}

let transformTestsArgs = [
    {
        addresses: ['should-be-overwritten'],
        outlets: {
            one: 1,
            two: 2,
            three: 3,
        },
    },
    4, 5, 6,
];

let transformTests = {
    address: {
        prop: 'addresses',
        args: ['addy1', 'addy2'],
        run: function(addressable) {
            let modified = addressable[this.prop](...this.args);
            // this allows us to bypass Expectable expected*() functions
            // and just check that the arguments are transformed correctly
            let stub = sinon.stub(modified, 'klass');
            modified._createInstance(...transformTestsArgs);
            stub.should.have.been.calledOnce;
            stub.should.have.been.calledWithNew;
            let callArgs = stub.getCall(0).args;
            callArgs.should.have.length(transformTestsArgs.length);
            callArgs.slice(1).should.deep.equal(transformTestsArgs.slice(1));
            callArgs[0].should.have.property('addresses');
            callArgs[0].addresses.should.deep.equal(this.args);
            stub.restore();
            return modified;
        }
    },
    outlets: {
        prop: 'outlets',
        args: ['one', 'three'],
        run: function(outletable) {
            let modified = outletable[this.prop](...this.args);
            let stub = sinon.stub(modified, 'klass');
            expect(modified.outlets).to.deep.equal(this.args);
            modified._createInstance(...transformTestsArgs);
            stub.should.have.been.calledOnce;
            stub.should.have.been.calledWithNew;
            let callArgs = stub.getCall(0).args;
            callArgs.should.have.length(transformTestsArgs.length);
            callArgs.slice(1).should.deep.equal(transformTestsArgs.slice(1));
            callArgs[0].should.have.property('outlets');
            callArgs[0].outlets.should.deep.equal({one: 1, three: 3});
            stub.restore();
            return modified;
{'fraction_non_alphanumeric': 0.13572607260726072, 'fraction_numerical': 0.007838283828382838, 'mean_word_length': 2.116323907455013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6875456', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1351, 'n_words': 250}