Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
adding stub for a mock DOM for resource loading testing, per #113
Browse files Browse the repository at this point in the history
  • Loading branch information
getify committed Mar 25, 2017
1 parent af3cbaa commit c5af28c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions mock-dom-resource-loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Mock for DOM resource loading

(function UMD(name,context,definition){
if (typeof define === "function" && define.amd) { define(definition); }
else if (typeof module !== "undefined" && module.exports) { module.exports = definition(); }
else { context[name] = definition(name,context); }
})("$DOM",this,function DEF(name,context){
"use strict";

return createDOM;


// **************************************

function createDOM(opts) {
var headElement = {};
var baseURI = "";

var $performance = {
getEntriesByName: getEntriesByName,
};

var $document = {
head: headElement,
baseURI: baseURI,
getElementsByTagName: getElementsByTagName,
createElement: createElement,
};

var publicAPI = {
document: $document,
performance: $performance,
};

return publicAPI;


// **************************************

function getElementsByTagName() {}
function createElement() {}
function getEntriesByName() {}
}
});

0 comments on commit c5af28c

Please sign in to comment.