react / wstein / node_modules / jest-cli / node_modules / node-haste / lib / test_helpers / loadResource.js
80668 views/**1* Copyright 2013 Facebook, Inc.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516var MessageList = require('../MessageList');1718function loadResource(loader, filePath, conf, expectation) {19var resource;20var error;21var complete = false;22runs(function() {23loader.loadFromPath(filePath, conf, function(e, r) {24resource = r;25error = e;26expect(e).toEqual(jasmine.any(MessageList));27complete = true;28});29});3031waitsFor(function() {32return complete;33}, 500);3435runs(function() {36expectation(error, resource);37});38}3940module.exports = loadResource;414243