2
我的整個默認頁面如下所示。在Win 8 JavaScript應用程序中運行QUnit-Metro,爲什麼「test」未定義?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Readingz</title>
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>
<!-- Readingz references -->
<script src="/js/default.js"></script>
<script src="/js/default_tests.js"></script>
<script src="/js/qunitmetro.js"></script>
<link href="/css/default.css" rel="stylesheet" />
<link href="/css/qunitmetro-light.css" rel="stylesheet" />
</head>
<body>
<p>Content goes here</p>
<!-- This is for testing only. It goes away when application is ready to ship. -->
<div id="qunit"></div>
</body>
</html>
我不斷收到測試未定義的錯誤。它看起來像我在上面列出的應用程序啓動的default.html頁面中。我已經通過Nuget添加了QUnit-Metro,所以我不確定是否需要在此時進行其他類型的關聯,甚至啓用ReSharper/Visual Studio的intellisense也會將測試顯示爲有效的函數調用。
Doh!就是這樣! 有時它只是需要另一雙眼睛。非常感激。乾杯。 – Adron 2012-08-16 17:39:00