Pārlūkot izejas kodu

Tests are compiled

Herbert Vojčík 10 gadi atpakaļ
vecāks
revīzija
abfb3522ac
3 mainītis faili ar 23 papildinājumiem un 1 dzēšanām
  1. 2 0
      root/.gitignore
  2. 20 1
      root/Gruntfile.js
  3. 1 0
      template.js

+ 2 - 0
root/.gitignore

@@ -1,2 +1,4 @@
 /node_modules/
 /bower_components/
+
+/test_runner.js

+ 20 - 1
root/Gruntfile.js

@@ -1,6 +1,7 @@
 'use strict';
 
 module.exports = function(grunt) {
+  var path = require('path');
 
   // Project configuration.
   grunt.initConfig({
@@ -11,11 +12,29 @@ module.exports = function(grunt) {
       '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
       '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
       ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
+    amberc: {
+      options: {
+        amber_dir: path.join(__dirname, "bower_components", "amber"),
+        closure_jar: ''
+      },
+      test_runner: {
+        src: ['node_modules/amber-dev/lib/Test.st'],
+        libraries: [
+          /* add dependencies packages here */
+          '{%= name %}', /* add other code-to-test packages here */
+          'SUnit',
+          '{%= name %}-Tests' /* add other test packages here */
+        ],
+        options: { library_dirs: ['src'] },
+        main_class: 'NodeTestRunner',
+        output_name: 'test_runner'
+      }
+    }
     // Task configuration.
   });
 
   // These plugins provide necessary tasks.
-  //grunt.loadNpmTasks('grunt-amberc');
+  grunt.loadNpmTasks('amber-dev');
 
   // Default task.
   //grunt.registerTask('default', ['']);

+ 1 - 0
template.js

@@ -79,6 +79,7 @@ exports.template = function(grunt, init, done) {
           "**/.*",
           "node_modules",
           "bower_components",
+          "/test_runner.js",
           "test",
           "tests"
         ],