'Verify that the messages generated when running tests are as expected
for the specified options and dev_mode.'

def verify_messages(self, options, dev_mode):

    is_coverage = options['coverage']
    port = options['port']
    expected_messages = []
    suites = (Env.JS_TEST_ID_KEYS if (options['suite'] == 'all') else [options['suite']])
    expected_messages.extend(self.EXPECTED_COMMANDS)
    if ((not dev_mode) and (not is_coverage)):
        expected_messages.append(self.EXPECTED_DELETE_JAVASCRIPT_REPORT_COMMAND.format(platform_root=self.platform_root))
    expected_messages.append(self.EXPECTED_INSTALL_NPM_ASSETS_COMMAND)
    expected_messages.append(self.EXPECTED_COFFEE_COMMAND.format(platform_root=self.platform_root))
    for suite in suites:
        karma_config_file = Env.KARMA_CONFIG_FILES[Env.JS_TEST_ID_KEYS.index(suite)]
        expected_test_tool_command = u'karma    start    {options}'.format(options=self.EXPECTED_KARMA_OPTIONS.format(config_file=karma_config_file, single_run=('false' if dev_mode else 'true'), suite=suite, platform_root=self.platform_root, browser=Env.KARMA_BROWSER))
        if is_coverage:
            expected_test_tool_command += self.EXPECTED_COVERAGE_OPTIONS.format(platform_root=self.platform_root, suite=suite)
        if port:
            expected_test_tool_command += u'    --port={port}'.format(port=port)
        expected_messages.append(expected_test_tool_command)
    self.assertEquals(self.task_messages, expected_messages)
