Worker from imported NPM module causing jest tests to fail - unit-testing

I installed browser-image-compression which, as part of its functionality, creates a Worker. Now when I run jest tests, I get the following error:
Test suite failed to run
ReferenceError: Worker is not defined
There are no tests connected to the function which uses browser-image-compression.
The scripts section in package.json has the following two lines
"test": "react-scripts test",
"test:ci": "cross-env CI=true react-scripts test"
Oh, and I have a file for setting up tests. Should I mock Worker in here?
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import '#domain/yup';
configure({
adapter: new Adapter()
});
global.fetch = require('jest-fetch-mock');

Late in responding to this but it could help others - but following this comment helped me with this issue.
If you add the following to its own file - I have mine within the same dir as the setupTests file named workerMock.js:
export default class Worker {
constructor(stringUrl) {
this.url = stringUrl;
this.onmessage = () => {};
}
postMessage(msg) {
this.onmessage(msg);
}
}
Then import that Worker file into your test setup file and add window.Worker = Worker. Your setup file may look like:
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import '#domain/yup';
import Worker from 'path-to-your-worker-file-above';
configure({
adapter: new Adapter()
});
global.fetch = require('jest-fetch-mock');
window.Worker = Worker;
Hope this helps

A better solution is that updating 'browser-image-compression' package to the latest version , this helped me .

Related

Issue integrating cypress-angular-unit-test into Cypress plugins

I am attempting to add the cypress-angular-unit-test plugin to Cypress.
However, following the instructions provided on the related GitHub page I am getting the following error:
The plugins file is missing or invalid.
/MyProjectName/cypress/plugins/index.js:1
import * as cypressTypeScriptPreprocessor from 'cy-ts-preprocessor';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Again, as instructed, I have added the following to support/index.js
// core-js 3.*
require('core-js/es/reflect');
// core-js 2.*
require('core-js/es7/reflect');
require('cypress-angular-unit-test/support');
And the following to plugins/index.js
import * as cypressTypeScriptPreprocessor from 'cy-ts-preprocessor';
module.exports = (on, config) => {
on('file:preprocessor', cypressTypeScriptPreprocessor);
require('#cypress/code-coverage/task')(on, config);
return config;
};
I've also added the related helper.js and cy-ts-preprocessor.js file to the plugins folder.
I've also added the necessary config to cypress.json
"experimentalComponentTesting": true,
I've even tried adding types/node by adding a tsconfig.json to the cypress folder like so:
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"],
"experimentalDecorators": true
},
"include": [
"**/*.ts"
]
}
Changing the target and/or lib values to es6 has no effect.
Changing the import to a require yields a different error which, even if it did work, seems like a hacky solution for some detail I am missing.
¯\_(ツ)_/¯
Not exactly an answer but at least a work around.
Start fresh or uninstall Cypress and cypress-angular-unit-test
Follow the instructions for Nx Cypress install found on here
Go back to cypress-angular-unit-test instructions and ignore this part:
Configure cypress/plugins/index.js to transpile Angular code.
import * as cypressTypeScriptPreprocessor from './cy-ts-preprocessor';
module.exports = (on, config) => {
on('file:preprocessor', cypressTypeScriptPreprocessor);
return config;
};
The file cy-ts-preprocessor is here

Flutter unit testing. error while running test

I am getting following error while running flutter unit test.
00:05 +1: ...
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/Refund_test.dart
Shell: [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: error:
import of dart:mirrors with
--enable-mirrors=false Shell: [ERROR:flutter/shell/common/engine.cc(175)] Could not prepare to run
the isolate. Shell: [ERROR:flutter/shell/common/engine.cc(122)] Engine
not prepare and launch isolate. Shell:
[ERROR:flutter/shell/testing/tester_main.cc(199)] Could not launch the
engine with configuration. 00:05 +1 -1: loading
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/Refund_test.dart
[E] Failed to load
"/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/Refund_test.dart":
Shell subprocess cleanly reported an error before connecting to test
harness. Check the logs above for an error message. Test:
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/Refund_test.dart
Shell:
/home/kazekage/Developement/flutter_linux_v1.2.1-stable/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester
Shell: [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: error: import of dart:mirrors with
--enable-mirrors=false Shell: [ERROR:flutter/shell/common/engine.cc(175)] Could not prepare to run
the isolate. Shell: [ERROR:flutter/shell/common/engine.cc(122)] Engine
not prepare and launch isolate. Shell:
[ERROR:flutter/shell/testing/tester_main.cc(199)] Could not launch the
engine with configuration. 00:05 +1 -2: loading
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/LineItem_test.dart
[E] Failed to load
"/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/LineItem_test.dart":
Shell subprocess cleanly reported an error before connecting to test
harness. Check the logs above for an error message. Test:
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/LineItem_test.dart
Shell:
/home/kazekage/Developement/flutter_linux_v1.2.1-stable/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester
Shell: [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: error: import of dart:mirrors with
--enable-mirrors=false Shell: [ERROR:flutter/shell/common/engine.cc(175)] Could not prepare to run
the isolate. Shell: [ERROR:flutter/shell/common/engine.cc(122)] Engine
not prepare and launch isolate. Shell:
[ERROR:flutter/shell/testing/tester_main.cc(199)] Could not launch the
engine with configuration. 00:06 +1 -3: loading
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/ShippingLine_test.dart
[E] Failed to load
"/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/ShippingLine_test.dart":
Shell subprocess cleanly reported an error before connecting to test
harness. Check the logs above for an error message. Test:
/home/kazekage/Projects/flutter/flutter_woocommerce/test/model/util/ShippingLine_test.dart
Shell:
/home/kazekage/Developement/flutter_linux_v1.2.1-stable/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester
pubsec.yml
name: flutter_woocommerce
description: A new Flutter package project.
version: 0.0.1
author:
homepage:
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
dio: ^2.1.6
built_value: ^6.6.0
built_value_generator: ^6.6.0
built_collection: ^4.2.2
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^4.0.0
build_runner: ^1.5.0
source_gen: ^0.9.4+2
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.io/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.io/custom-fonts/#from-packages
flutter doctor
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2018.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.35.0)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Tag.dart
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:flutter_woocommerce/model/util/Link.dart';
part 'Tag.g.dart';
abstract class Tag implements Built<Tag, TagBuilder> {
static Serializer<Tag> get serializer => _$tagSerializer;
int get id;
String get name;
String get slug;
#nullable
String get description;
#nullable
int get count;
#nullable
#BuiltValueField(wireName: '_links')
Link get links;
Tag._();
factory Tag([updates(TagBuilder b)]) = _$Tag;
}
Tag_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'dart:convert';
import 'package:built_collection/built_collection.dart';
import 'package:flutter_woocommerce/test_strings.dart';
import 'package:flutter_woocommerce/model/Serializers.dart';
import 'package:flutter_woocommerce/model/Tag.dart';
import 'package:flutter_woocommerce/model/util/Link.dart';
void main() {
final parsedJson = json.decode(TestStrings.TAG_JSON);
Tag tag = serializers.deserializeWith(Tag.serializer, parsedJson);
test('id', () {
expect(tag.id, 32);
});
test('name', () {
expect(tag.name, 'Telephone');
});
test('slug', () {
expect(tag.slug, 'telephone');
});
test('description', () {
expect(tag.description, '');
});
test('count', (){
expect(tag.count, 0);
});
test('_links is Link Object', () {
expect(tag.links, isInstanceOf<Link>());
});
test('_links > self is href[]', () {
expect(tag.links.self, isInstanceOf<BuiltList<Href>>());
});
test('_links > collection is href[]', () {
expect(tag.links.collection, isInstanceOf<BuiltList<Href>>());
});
test('_links > collection > href value', () {
expect(tag.links.collection.first.href, 'http://paathsala-wp.test/wp-json/wc/v2/products/tags');
});
}
The problem is that you're trying to use reflection (dart:mirror), which is not possible with Flutter because:
"Since reflection makes all code implicitly used by default, it interferes with tree shaking." Source
I believe it is related with the JSON serialization provided by the built_value_generator dart package.
It seems I have imported a wrong library in one of my model class. Once I removed the library
import 'package:built_collection/built_collection.dart';
All the tests are passing.

Vue vue-sweetalert2 . error in test:unit with Jest

As per the vue-sweetalert2 doc, in my main.js, I import and use the plugin:
import VueSweetalert2 from "vue-sweetalert2";
Vue.use(VueSweetalert2);
In my component, ContactForm.vue, I can use:
this.$swal(...)
However, when I test:unit this component, I need to add the import and Vue.use()
import VueSweetalert2 from "vue-sweetalert2";
Vue.use(VueSweetalert2);
and I get an error:
$ vue-cli-service test:unit ContactForm.spec.js
FAIL tests/unit/ContactForm.spec.js
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/Users/yves/Developments/WIP/VUE.JS-cli-3/3-chocha-home-content/chocha/node_modules/vue-sweetalert2/src/index.js:2
import swal from 'sweetalert2/dist/sweetalert2.min.js';
^^^^^^
SyntaxError: Unexpected token import
What could be wrong?
UPDATE
the vue-sweetalert2/src/index.js, line 2 faulty line, is:
// #ts-check
import swal from 'sweetalert2/dist/sweetalert2.min.js';
the developer of this wrapper added an index.d.ts fie
import Vue, { PluginObject, PluginFunction } from 'vue';
import * as swal from 'sweetalert2';
...
but it seems not to be taken in account.
SOLVED ...
I added a transformIgnorePatterns in my jest config in package.json
"jest": {
....
"transformIgnorePatterns": [
"/node_modules/(?!vue-sweetalert2).+\\.js$"
],
....
}

gulp and running django server with logging

I'm trying to run a django server from gulp. Although I've now managed (roughly) to activate the virtual env and then start the server, none of the output/errors from the django server appears. How can I get this to appear when using gulp?
gulpfile.js
var pjson = require('./package.json');
// Run django server
var cmd = 'workon switcher5'
gulp.task('runServer', function() {
exec('~/virtualenvs/' + pjson.name + '/bin/python manage.py runserver', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
});
});
Note although the server runs fine. I am getting the error in the console:
/bin/sh: /Users/User/virtualenvs/switcher5/bin/python: No such file or directory
(Running the django server not via gulp works as normal. )
I tried to spawn a process instead:
gulp.task('runServer', function(){
console.info('starting django server');
var PIPE = {stdio: 'inherit'};
spawn('~/virtualenvs/' + pjson.name + '/bin/python', ['manage.py', 'runserver'], PIPE);
});
However although that ran with
spawn('python', ['manage.py', 'runserver'], PIPE);from the terminal (activating virtualenv before manually running via the above fails.
I'm not clear what's wrong with the path (if anything)
When it ran from the terminal it now gives output, but seems to be only errors from the django server (304's etc...), but no successful requests appear.
I have struggled with this exact concept for a while. The examples that I've seen have everything all in one gulpfile.js, where I have things more modular. Additionally, I had it working with a prior Django project, but then broke it with my next project when I followed the Two Scoops method of breaking up your configuration files.
I finally got it working by creating the files below (Windows-based machine) and then running 'gulp watch' from the bash command line:
Basic Project Folder Structure:
root folder
|_ project folder
|_ config folder
|_ gulp
|_ tasks
runserver.js
watch.js
|_ gulpfile.js
gulpfile.js:
// Load gulp script modules
require('./gulp/tasks/runserver');
require('./gulp/tasks/watch');
runserver.js
// Starts python django server
// Import packages
var gulp = require('gulp'),
spawn = require('child_process').spawn;
// Start the Django runserver
gulp.task('startDjango', function(cb){
var projDir = 'C:\\<<project folder>>'
var envDir = 'C:\\<<virtual environment directory>>'
var cmd = spawn('python', [projDir + '\\manage.py', 'runserver'],
{cwd: envDir, stdio: 'inherit'}
);
cmd.on('close', function(code) {
console.log('startDjango exited with code ' + code);
cb(code);
});
});
watch.js:
// Kicks off Django server, opens and syncs browser upon changes
// Import packages
var gulp = require('gulp'),
watch = require('gulp-watch'),
browserSync = require('browser-sync').create();
// WATCH for changes to files
gulp.task('watch', function(){
// Start python django server
gulp.start('startDjango');
// Sync browsers to python runserver
browserSync.init({
notify: false,
localOnly: true,
proxy: {
target: 'http://localhost:8000/',
},
port: process.env.PORT || 8000,
});
// Refresh the browser whenever any HTML file is changed
watch('./**/*.html', function(){
browserSync.reload();
});
... // Other watch activities here
});
Hope this helps anyone else who's struggling. :)
The key issue in the question was to get gulp to launch a virtualenv then launch the django server while passing the output from it to node via stdout.
The other answer mention unfortunately doesn't achieve this as it doesn't launch a virtualenv at the same time.
The solution below, does work.
(note if you don't use virtualenv in a venv/ folder then just adjust the below to the relevant location
// Activates a virtualenv and runs django server
gulp.task('runServer', function(cb) {
var cmd = spawn('venv/bin/python', ['manage.py', 'runserver'], {stdio: 'inherit'});
cmd.on('close', function(code) {
console.log('runServer exited with code ' + code);
cb(code);
});
});

How do I unit test akka actors in Play Framework 2.2.0 Scala (spec2, Mockito)

I am trying to set up some unit tests with the Play framework. A lot of my logic is built into scheduled akka actors that go off and gather data in the background. My problem is that I can't figure out how to unit test them. I literally have no clue how to approach it. I'm trying to use akka-testkit, but I'm basically flailing around. Does anyone have any suggestions on how to even approach it? Examples would be incredibly useful. This is an example of the abomination I am currently working with:
package test
import org.specs2.mutable._
import controllers.Scanner
import java.util.UUID
import org.joda.time.DateTime
import akka.testkit.TestActorRef
import play.api.Logger
import play.api.test.{FakeApplication, TestServer}
import models.PSqlEnum
class ScannerTest extends Specification {
val appId = UUID.randomUUID()
val app = models.App(appId, "TestApp", "TestServer", "TestComponent", "Test Description", DateTime.now(),
DateTime.now(), true, 3, 60, PSqlEnum("scanType", "mandatory"), "http://localhost")
val rules = <Rule name="DivisionDataIsAvailable" elementsToCheck="DivisionDataIsAvailable"
ruleType="is, true, yellow" />
<Rule name="DivisionDataLoadIsHealthy" elementsToCheck="DivisionDataLoadIsHealthy"
ruleType="is, true, red" />;
"Scanner" should {
"test something" in {
val fakeApp = TestServer(3333)
fakeApp.start()
implicit val actorSystem = play.api.libs.concurrent.Akka.system(fakeApp.application)
val scanner = TestActorRef(new Scanner(app, rules)).underlyingActor
Logger.warn(scanner.getResponseFromWebService.toString)
fakeApp.stop()
1 === 1
}
}
}
This is obviously not really testing anything. I am basically trying to get it to get through to the 1 === 1 at this point just to see if I can get the runtime errors to stop. The errors this code is generating are these:
INFO - Starting application default Akka system.
[info] ScannerTest
[info] Scanner should
[info] ! test something
[error] ThrowableException: akka.actor.LocalActorRef.<init>(Lakka/actor/ActorSystemImpl;Lakka/actor/Props;Lakka/actor/InternalActorRef;Lakka/actor/ActorPath;)V (TestActorRef.scala:21)
[error] akka.testkit.TestActorRef.<init>(TestActorRef.scala:21)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:135)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:132)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:125)
[error] test.ScannerTest$$anonfun$1$$anonfun$apply$3.apply(ScannerTest.scala:27)
[error] test.ScannerTest$$anonfun$1$$anonfun$apply$3.apply(ScannerTest.scala:23)
[error] akka.actor.LocalActorRef.<init>(Lakka/actor/ActorSystemImpl;Lakka/actor/Props;Lakka/actor/InternalActorRef;Lakka/actor/ActorPath;)V
[error] akka.testkit.TestActorRef.<init>(TestActorRef.scala:21)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:135)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:132)
[error] akka.testkit.TestActorRef$.apply(TestActorRef.scala:125)
[error] test.ScannerTest$$anonfun$1$$anonfun$apply$3.apply(ScannerTest.scala:27)
[error] test.ScannerTest$$anonfun$1$$anonfun$apply$3.apply(ScannerTest.scala:23)
[info] Total for specification ScannerTest
[info] Finished in 86 ms
[info] 1 example, 0 failure, 1 error
[info] test.ScannerTest
I believe that I need to create a FakeApplication and use that FakeApplication's Akka.system; however, I am not sure how to do it. To be honest, I am not even sure if that is the correct approach. If I could just generate a generic Akka.system and have that work I'd be ecstatic. If anyone has any ideas on how to tackle this I'd be really appreciative.
Okay, I figured it out. Make sure you are using the correct version of akka-testkit. In Play 2.2.0 I was trying to use akka 2.2.M3. Obviously, that doesn't work. I had to put the correct dependencies in my Build.scala, which ended up being this:
"com.typesafe.akka" %% "akka-testkit" % "2.2.0" % "test"
My actual test code looks like this:
package test
import org.specs2.mutable._
import controllers.Scanner
import java.util.UUID
import org.joda.time.DateTime
import akka.testkit.TestActorRef
import play.api.Logger
import models.PSqlEnum
import akka.actor.ActorSystem
import com.typesafe.config.ConfigFactory
import scala.concurrent.ExecutionContext.Implicits.global
class ScannerTest extends Specification {
val appId = UUID.randomUUID()
val app = models.App(appId, "TestApp", "TestServer", "TestComponent", "Test Description", DateTime.now(),
DateTime.now(), true, 3, 60, PSqlEnum("scanType", "mandatory"), "http://localhost")
val rules = <Rule name="DivisionDataIsAvailable" elementsToCheck="DivisionDataIsAvailable"
ruleType="is, true, yellow" />
<Rule name="DivisionDataLoadIsHealthy" elementsToCheck="DivisionDataLoadIsHealthy"
ruleType="is, true, red" />;
"Scanner" should {
"test something" in {
implicit val actorSystem = ActorSystem("testActorSystem", ConfigFactory.load())
val scanner = TestActorRef(new Scanner(app, rules)).underlyingActor
val response = scanner.getResponseFromWebService
response onSuccess {
case result => Logger.warn(result.toString)
}
response onFailure {
case error => Logger.warn(error.toString)
}
1 === 1
}
}
}
Obviously again, this test isn't really doing anything. The actual test being evaluated is 1 === 1. It does print out to the log now though which means I can go back and verify datatypes and the payload of the response, and then build some actual Unit Tests. I hope someone finds this useful. Those error messages in the original question are caused by the akka-testkit dependency not being the same version as Akka though, which might be useful for someone.
I'm not using spec2 or Mockito but here is what I'm doing to unit test Akka actors in Play 2.2.1:
import org.specs2.mutable.Specification
import scala.concurrent.duration._
import org.scalatest.concurrent._
import akka.testkit._
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.{FlatSpec, BeforeAndAfterAll}
import akka.actor.{Props, ActorSystem}
import akka.pattern.ask
import akka.util.Timeout
import scala.util.{Failure, Success}
import model.BlacklistEntry
import scala.concurrent.{Future, Promise, Await}
import scala.concurrent.ExecutionContext.Implicits.global
import play.api.test.FakeApplication
import model.BlacklistEntryImpl
class LicenceBlackListSpec(_system: ActorSystem) extends TestKit(_system) with ImplicitSender with ShouldMatchers with FlatSpec with BeforeAndAfterAll {
play.api.Play.start(FakeApplication())
import akka.testkit.TestKit._
def this() = this( ActorSystem("LicenceBlackListSpec") )
override def afterAll: Unit = {
system.shutdown()
system.awaitTermination(10.seconds)
}
implicit val timeout = Timeout(10 seconds)
val blacklistRef = TestActorRef(Props[LicenceBlackList])
"An LicenceBlackList Actor" should "be able to create a new blacklist entry" in {
blacklistRef ! CreateEntry(BlacklistEntryImpl("NEW_KEY",1000,"Test creation"))
val expected: BlacklistEntry = BlacklistEntryImpl("NEW_KEY", 1000 ,"Test creation")
expectMsg( expected )
}
}
You'll need to include the scalatest lib as a dependency as well akka test kit:
"org.scalatest" % "scalatest_2.10" % "1.9.1"
Hope this will help.
I don't use ActorSystem("testActorSystem" ) , I have tryed to allow play framework to use it's usual akka plugin. This approach has folowing benefits: I can use play.api.libs.concurrent.Akka.system in all code, I can have extra config options that understand booth play and akka code parts .
class BaseActorTester (_app: Application) extends akka.testkit.TestKit(play.api.libs.concurrent.Akka.system(_app)) with FunSuiteLike with BeforeAndAfterAll {
def this() = this(FakeApplication(additionalConfiguration=Map("currency.db"->"airando-test")))
implicit val app: Application = _app
implicit val ec = play.api.libs.concurrent.Akka.system.dispatcher
override def beforeAll {
Play.start(app)
}
// play plugin do it itself ??
//override def afterAll {
// akka.testkit.TestKit.shutdownActorSystem(system)
//}
...
}