import { run } from '@ember/runloop';
import { NAMESPACES, NAMESPACES_BY_ID } from '@ember/-internals/metal';

function NamespacesAssert(env) {
  this.env = env;
}

NamespacesAssert.prototype = {
  reset: function() {},
  inject: function() {},
  assert: function() {
    let { assert } = QUnit.config.current;

    if (NAMESPACES.length > 0) {
      assert.ok(false, 'Should not have any NAMESPACES after tests');
      run(() => {
        let namespaces = NAMESPACES.slice();
        for (let i = 0; i < namespaces.length; i++) {
          namespaces[i].destroy();
        }
      });
    }
    let keys = Object.keys(NAMESPACES_BY_ID);
    if (keys.length > 0) {
      assert.ok(false, 'Should not have any NAMESPACES_BY_ID after tests');
      for (let i = 0; i < keys.length; i++) {
        delete NAMESPACES_BY_ID[keys[i]];
      }
    }
  },
  restore: function() {},
};

export default NamespacesAssert;

@@ -104,24 +104,36 @@
 etal';%0A%0A
-function
+export default class
  Namespa
@@ -145,16 +145,32 @@
 sert
+ %7B%0A  constructor
 (env) %7B%0A
   th
@@ -165,16 +165,18 @@
 (env) %7B%0A
+  
   this.e
@@ -189,65 +189,26 @@
 nv;%0A
+  
 %7D%0A%0A
-NamespacesAssert.prototype = %7B%0A  reset: function
+  reset
 () %7B%7D
-,
+%0A
 %0A  i
@@ -212,32 +212,22 @@
   inject
-: function
 () %7B%7D
-,
+%0A
 %0A  asser
@@ -227,26 +227,16 @@
   assert
-: function
 () %7B%0A   
@@ -811,17 +811,17 @@
    %7D%0A  %7D
-,
+%0A
 %0A  resto
@@ -826,58 +826,12 @@
 tore
-: function
 () %7B%7D
-,
 %0A%7D
-;%0A%0Aexport default NamespacesAssert;
 %0A

Convert `NamespacesAssert` to ES6 class