File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+ require 'support/editor'
3
+ require 'support/playground_actions'
4
+
5
+ RSpec . feature "Testing the code" , type : :feature , js : true do
6
+ include PlaygroundActions
7
+
8
+ before { visit '/' }
9
+
10
+ scenario "when a crate type is provided" do
11
+ code = <<~EOF
12
+ #![crate_type = "proc-macro"]
13
+
14
+ use proc_macro::TokenStream;
15
+
16
+ #[proc_macro]
17
+ pub fn demo(input: TokenStream) -> TokenStream {
18
+ input
19
+ }
20
+ EOF
21
+ editor . set ( code )
22
+
23
+ in_build_menu { click_on ( build_button : "Test" ) }
24
+ within ( :output , :stdout ) do
25
+ expect ( page ) . to have_content "running 0 tests"
26
+ end
27
+ end
28
+
29
+ def editor
30
+ Editor . new ( page )
31
+ end
32
+ end
Original file line number Diff line number Diff line change @@ -263,7 +263,11 @@ function performAutoOnly(): ThunkAction {
263
263
264
264
const performExecuteOnly = ( ) : ThunkAction => performCommonExecute ( 'bin' , false ) ;
265
265
const performCompileOnly = ( ) : ThunkAction => performCommonExecute ( 'lib' , false ) ;
266
- const performTestOnly = ( ) : ThunkAction => performCommonExecute ( 'lib' , true ) ;
266
+ const performTestOnly = ( ) : ThunkAction => ( dispatch , getState ) => {
267
+ const state = getState ( ) ;
268
+ const crateType = getCrateType ( state ) ;
269
+ return dispatch ( performCommonExecute ( crateType , true ) ) ;
270
+ } ;
267
271
268
272
interface GenericApiFailure {
269
273
error : string ;
You can’t perform that action at this time.
0 commit comments