Test IndexedDB deleteIndex method On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". dbname = "deleteIndex.html" indexedDB.deleteDatabase(dbname) indexedDB.open(dbname) objectStore = db.createObjectStore('foo'); Expecting exception from objectStore.deleteIndex('first') PASS Exception was thrown. PASS code is DOMException.NOT_FOUND_ERR PASS ename is 'NotFoundError' Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found. PASS objectStore.deleteIndex() threw exception TypeError: Failed to execute 'deleteIndex' on 'IDBObjectStore': 1 argument required, but only 0 present.. index = objectStore.createIndex('first', 'first'); Expecting exception from objectStore.deleteIndex('FIRST') PASS Exception was thrown. PASS code is DOMException.NOT_FOUND_ERR PASS ename is 'NotFoundError' Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found. index = objectStore.createIndex('second', 'second'); returnValue = objectStore.deleteIndex('first'); PASS returnValue is undefined Expecting exception from db.createObjectStore('bar'); PASS Exception was thrown. PASS code is DOMException.INVALID_STATE_ERR PASS ename is 'InvalidStateError' Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The database is not running a version change transaction. Expecting exception from objectStore.deleteIndex('second') PASS Exception was thrown. PASS code is 0 PASS ename is 'TransactionInactiveError' Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The transaction has finished. PASS successfullyParsed is true TEST COMPLETE