Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit cce24aa

Browse files
author
Matthew Ault
committed
update tests to not fail when adding middleware post-init
1 parent f5b480b commit cce24aa

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

test/analytics.test.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,19 +2043,13 @@ describe('Analytics', function() {
20432043
}
20442044
});
20452045

2046-
it('should throw an error if AJS has already initialized', function() {
2046+
it('should not throw an error if AJS has already initialized', function() {
20472047
analytics.init();
20482048
try {
20492049
analytics.addIntegrationMiddleware(function() {});
2050-
2051-
// This assert should not run.
2052-
assert(false, 'error was not thrown!');
20532050
} catch (e) {
2054-
assert(
2055-
e.message ===
2056-
'attempted to add an integration middleware after initialization',
2057-
'wrong error return'
2058-
);
2051+
// This assert should not run.
2052+
assert(false, 'error was thrown!');
20592053
}
20602054
});
20612055

@@ -2092,19 +2086,13 @@ describe('Analytics', function() {
20922086
}
20932087
});
20942088

2095-
it('should throw an error if AJS has already initialized', function() {
2089+
it('should not throw an error if AJS has already initialized', function() {
20962090
analytics.init();
20972091
try {
20982092
analytics.addSourceMiddleware(function() {});
2099-
2093+
} catch (e) {
21002094
// This assert should not run.
21012095
assert(false, 'error was not thrown!');
2102-
} catch (e) {
2103-
assert(
2104-
e.message ===
2105-
'attempted to add a source middleware after initialization',
2106-
'wrong error return'
2107-
);
21082096
}
21092097
});
21102098

0 commit comments

Comments
 (0)