diff --git a/test/WebSites/BasicWebSite/package.json b/test/WebSites/BasicWebSite/package.json index a0d2a37b7a..991cd8ebe7 100644 --- a/test/WebSites/BasicWebSite/package.json +++ b/test/WebSites/BasicWebSite/package.json @@ -6,5 +6,6 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-bower-task": "^0.4.0" - } + }, + "private" : true } \ No newline at end of file diff --git a/test/WebSites/MvcTagHelpersWebSite/karma.conf.js b/test/WebSites/MvcTagHelpersWebSite/karma.conf.js new file mode 100644 index 0000000000..bc9b349480 --- /dev/null +++ b/test/WebSites/MvcTagHelpersWebSite/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Wed Feb 18 2015 20:46:05 GMT-0800 (Pacific Standard Time) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + 'test/**/*.js' + ], + + + // list of files to exclude + exclude: [ + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + // forward some requests to another server + proxies: { + "/MvcTagHelper_Home": "http://localhost:5000" + }, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true + }); +}; diff --git a/test/WebSites/MvcTagHelpersWebSite/package.json b/test/WebSites/MvcTagHelpersWebSite/package.json new file mode 100644 index 0000000000..11ef5ae93a --- /dev/null +++ b/test/WebSites/MvcTagHelpersWebSite/package.json @@ -0,0 +1,13 @@ +{ + "version": "0.0.0", + "name": "MvcTagHelpersWebSite", + "description": "Web site demonstrating various MVC tag helpers.", + "devDependencies": { + "jasmine-core": "^2.2.0", + "karma": "^0.12.31", + "karma-jasmine": "^0.3.5", + "karma-phantomjs-launcher": "^0.1.4", + "karma-teamcity-reporter": "^0.1.2" + }, + "private": true +} diff --git a/test/WebSites/MvcTagHelpersWebSite/test/test-jasmine.js b/test/WebSites/MvcTagHelpersWebSite/test/test-jasmine.js new file mode 100644 index 0000000000..3a20ffb3fb --- /dev/null +++ b/test/WebSites/MvcTagHelpersWebSite/test/test-jasmine.js @@ -0,0 +1,49 @@ +describe("Basic function that doesn't use service", function() { + if (typeof NS == 'undefined') { NS = {}; } + + NS.myFunction = { + // empty stuff array, filled during initialization + stuff: [], + + init: function init() { + this.stuff.push('Testing'); + }, + reset: function reset() { + this.stuff = []; + }, + append: function append(string1, string2) { + return string1 + ' ' + string2; + } + }; + + var myfunc = NS.myFunction; + + beforeEach(function(){ + spyOn(myfunc, 'init').and.callThrough(); + }); + + afterEach(function() { + myfunc.reset(); + }); + + it("should be able to initialize", function() { + expect(myfunc.init).toBeDefined(); + myfunc.init(); + expect(myfunc.init).toHaveBeenCalled(); + }); + + it("should populate stuff during initialization", function(){ + myfunc.init(); + expect(myfunc.stuff.length).toEqual(1); + expect(myfunc.stuff[0]).toEqual('Testing'); + }); + + describe("appending strings", function() { + it("should be able to append 2 strings", function() { + expect(myfunc.append).toBeDefined(); + }); + it("should append 2 strings", function() { + expect(myfunc.append('hello', 'world')).toEqual('hello world'); + }); + }); +}); \ No newline at end of file diff --git a/test/WebSites/MvcTagHelpersWebSite/test/test-script.js b/test/WebSites/MvcTagHelpersWebSite/test/test-script.js new file mode 100644 index 0000000000..17f03e0d62 --- /dev/null +++ b/test/WebSites/MvcTagHelpersWebSite/test/test-script.js @@ -0,0 +1,11 @@ + +describe("