Default forbidDuplicateNames to true

This commit is contained in:
Steve Gravrock
2025-09-14 10:06:47 -07:00
parent 3040abe23d
commit 7c34b43607
5 changed files with 14 additions and 14 deletions

View File

@@ -3345,9 +3345,9 @@ getJasmineRequireObj().Configuration = function(j$) {
* error.
* @name Configuration#forbidDuplicateNames
* @type boolean
* @default false
* @default true
*/
forbidDuplicateNames: false,
forbidDuplicateNames: true,
/**
* Whether to issue warnings for certain deprecated functionality
* every time it's used. If not set or set to false, deprecation warnings

View File

@@ -25,7 +25,7 @@ describe('Configuration', function() {
expect(subject.specFilter()).toEqual(true);
expect(subject.hideDisabled).toEqual(false);
expect(subject.autoCleanClosures).toEqual(true);
expect(subject.forbidDuplicateNames).toEqual(false);
expect(subject.forbidDuplicateNames).toEqual(true);
expect(subject.verboseDeprecations).toEqual(false);
expect(subject.detectLateRejectionHandling).toEqual(false);
});

View File

@@ -487,14 +487,14 @@ describe('Env', function() {
it('does not throw an error when called in a describe', function() {
env.setParallelLoadingState('helpers');
check();
check(1);
env.setParallelLoadingState('specs');
check();
check(2);
function check() {
function check(disambiguator) {
let done = false;
env.describe('a suite', function() {
env.describe('a suite ' + disambiguator, function() {
expect(function() {
env.it('a spec');
env.beforeAll(function() {});
@@ -594,14 +594,14 @@ describe('Env', function() {
it('does not throw an error when called in a describe', function() {
env.setParallelLoadingState('helpers');
check();
check(1);
env.setParallelLoadingState('specs');
check();
check(2);
function check() {
function check(disambiguator) {
let done = false;
env.describe('a suite', function() {
env.describe('a suite ' + disambiguator, function() {
expect(function() {
env.it('a spec');
env.afterAll(function() {});

View File

@@ -40,7 +40,7 @@ describe('spec running', function() {
env.it('should run nested suites', function() {
foo++;
});
env.it('should run nested suites', function() {
env.it('should run nested suites 2', function() {
bar++;
});
});

View File

@@ -95,9 +95,9 @@ getJasmineRequireObj().Configuration = function(j$) {
* error.
* @name Configuration#forbidDuplicateNames
* @type boolean
* @default false
* @default true
*/
forbidDuplicateNames: false,
forbidDuplicateNames: true,
/**
* Whether to issue warnings for certain deprecated functionality
* every time it's used. If not set or set to false, deprecation warnings