<commit_before>describe('Components: Default loader', function() {

    var testComponentName = 'test-component';

    afterEach(function() {
        ko.components.unregister(testComponentName);
    });

    it('Allows registration of arbitrary component config objects, reports that they are registered, and allows unregistration', function() {
        ko.components.register(testComponentName, {});

        expect(ko.components.isRegistered(testComponentName)).toBe(true);
        expect(ko.components.isRegistered('other-component')).toBe(false);

        ko.components.unregister(testComponentName, {});
        ko.components.unregister('nonexistent-component', {}); // No error - it's just a no-op, since it's harmless

        expect(ko.components.isRegistered(testComponentName)).toBe(false);
    });

    it('Allows registering component names that may conflict with properties on Object.prototype', function() {
        var prototypeProperty = 'toString';

        expect(ko.components.isRegistered(prototypeProperty)).toBe(false);
        ko.components.register(prototypeProperty, {});
        expect(ko.components.isRegistered(prototypeProperty)).toBe(true);
    });

    it('Throws if you try to register a component that is already registered', function() {
        ko.components.register(testComponentName, {});

        expect(function() {
            ko.components.register(testComponentName, {});
        }).toThrow();
    });

    it('Throws if you try to register a falsey value', function() {
        expect(function() {
            ko.components.register(testComponentName, null);
        }).toThrow();

        expect(function() {
            ko.components.register(testComponentName, undefined);
        }).toThrow();
    });
<commit_msg>Test ko.components.unregister for name that conflicts with Object.prototype<commit_after>describe('Components: Default loader', function() {

    var testComponentName = 'test-component';

    afterEach(function() {
        ko.components.unregister(testComponentName);
    });

    it('Allows registration of arbitrary component config objects, reports that they are registered, and allows unregistration', function() {
        ko.components.register(testComponentName, {});

        expect(ko.components.isRegistered(testComponentName)).toBe(true);
        expect(ko.components.isRegistered('other-component')).toBe(false);

        ko.components.unregister(testComponentName, {});
        ko.components.unregister('nonexistent-component', {}); // No error - it's just a no-op, since it's harmless

        expect(ko.components.isRegistered(testComponentName)).toBe(false);
    });

    it('Allows registering component names that may conflict with properties on Object.prototype', function() {
        var prototypeProperty = 'toString';

        expect(ko.components.isRegistered(prototypeProperty)).toBe(false);
        ko.components.register(prototypeProperty, {});
        expect(ko.components.isRegistered(prototypeProperty)).toBe(true);

        ko.components.unregister(prototypeProperty);
        expect(ko.components.isRegistered(prototypeProperty)).toBe(false);
    });

    it('Throws if you try to register a component that is already registered', function() {
        ko.components.register(testComponentName, {});

        expect(function() {
            ko.components.register(testComponentName, {});
        }).toThrow();
    });

    it('Throws if you try to register a falsey value', function() {
        expect(function() {
            ko.components.register(testComponentName, null);
        }).toThrow();

        expect(function() {
            ko.components.register(testComponentName, undefined);
        }).toThrow();
    });

{'fraction_non_alphanumeric': 0.12759084791386271, 'fraction_numerical': 0.0, 'mean_word_length': 3.482509047044632, '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': '6974792', 'n_tokens_mistral': 941, 'n_tokens_neox': 913, 'n_words': 195}