Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Union array of strings made unpredictable results #7

Open
KainHaart opened this issue May 23, 2016 · 0 comments
Open

Union array of strings made unpredictable results #7

KainHaart opened this issue May 23, 2016 · 0 comments

Comments

@KainHaart
Copy link

While lodash union works perfectly fine
Extendify with union strategy makes array of strings a complete mess

describe('extendify', function() {
    var chai = require('chai');
    var expect = chai.expect;

    describe('lodash', function() {
        var _ = require('lodash');
        it('lodash union', function() {
            expect(_.union(['mocha', 'chai', 'closure'], ['closure']))
                .deep.equal(['mocha', 'chai', 'closure']); // OK
        });
    });

    describe('extendify', function() {
        it('union array of strings', function() {
            var extend = require('extendify')({
                arrays: 'union',
                inPlace: false
            });

            expect(extend(['mocha', 'chai', 'closure'], ['closure']))
                .deep.equal(['mocha', 'chai', 'closure'] // WTF ['closure', 'chai', 'closure']
            );
        });
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant